I have searched up the manual and the forum extensively about this and haven’t found a complete answer.
I’m very confused about these paths, where to set them up, how to use them, where are they stored in the generated files, is there global variables ?
Let me expose what I know and I’ll ask you my questions at the end.
#1. Within Scriptcase, I can set up the paths below
#2. Within applications, we can set up the 2 paths below
#3. When we deploy (advanced mode), we can set up the 4 paths below
#4. When I use an Application Form and set up a “Image (File Name)” field or “Document (File Name)” field, the selected file ends up in the directory defined in #1 above. So this works properly.
Q1 . Why the “Documents” path is absolute and the “Image” path is relative ?
Q2 . How are the paths set up at the application level (see #2 above) used ? Do they surcharge the settins made in the developement environment (#1) ?
Q3 . From my development environment, to access the Image folder for instance, I have to prefix the image file name with “…/…/…/file/img” because the applications are in the “wwwroot\scriptcase\app” folder and the “img” and “doc” folders are in the wwwroot\scriptcase\file" folder. But from the production environment, I have to prefix the image name with “…/_lib/file/img”. How am I supposed to handle this in the code to write the code only once ?
Q4 . In a ReportPDF application, I have found out that the macro “sc_pdf_image()” used the “Layout PDF/Code” area can’t take a variable for its first parameter (image path name). Indeed I have tried many different ways to use a variable so I can get my image paths from somewhere else (config, database, global variable), but it looks like there is a problem with the forward slashes! See below. If I store the “…/…/…/file/img/” in a PHP variable and use it here instead, it does not work.
sc_pdf_image(’…/…/…/file/img/’ . $topImgName ,$topImgX,$topImgY,$topImgWidth,$topImgHeight, $fileExt);
So my question here is: how can I use the “sc_pdf_image()” function in the development and the production environment without having to replace this code when deploying?
I’m sure I must have missed something somewhere because everyone must have the same issue.
Thanks a lot for your assistance.