Morning,
I am trying to upload files, in this case images to variable locations.
In the formatting table (7 from 12) i can set edit as field to document upload and define a path
i.e ../bilder/
this is fine as a base directory but I wish to store the images in directorys which define from whre they come.
This is an exanple of what I´ve managed to do, for the upload it works bit not for the view.
I change the function GetUpöoadFolder in _functions :
function GetUploadFolder($field,$table)
{
$path="";
##ALLFIELDS## if($field=="##FIELD##") $path="##UPLOADFOLDER##";
##/ALLFIELDS##
if(strlen($path) && substr($path,strlen($path)-1) != "/")
$path.="/";
if ($table == "acc_einheit"){
$path.= $_SESSION["acc_objekt_masterkey"]."/".$_SESSION["acc_einheit_masterkey"]."/";
}
if ($table == "acc_objekt"){
$path.= $_SESSION["acc_objekt_masterkey"]."/".$_SESSION["acc_einheit_masterkey"]."/";
}
return $path;
}
This is just an example of what I need.
Objekt number 496
Einheit number 3
which gives me the directory path for images from the above Objekt and Einheit
../bilder/496/3/haus2.jpg
The file is then uploaded but only if the directory already exists!
Now to my Questions:
- Where can I set the path for viewing the images I upload as shown above.
- Why insn´t the directory created automatically as stated in the Thumb Tutorial, all rights are set on the webserver.
Thanks in advance
Robert