hi
i'm using this before record add/updated event:
// ok, va bene
//$values["nome_istituto"] viene usata come nome della directory
global $pageObject;
foreach( $pageObject->filesToMove as $key=>$val)
{
if($pageObject->filesToMove[$key]->sourceFilename==$_FILES["value_licenza_istituto_1"]["tmp_name"])
{
//crea la directory se non esiste
$dirname= "licenze_istituti/".$values["nome_istituto"];
if (is_dir($dirname)) {
} else {
mkdir("licenze_istituti/".$values["nome_istituto"], 0777);
}
$pageObject->filesToMove[$key]->destFilename =
$values["nome_istituto"]."/".$_FILES["value_licenza_istituto_1"]["name"];
}
}
$values["licenza_istituto"] = $_FILES["value_licenza_istituto_1"]["name"];
// ok, va bene
define("MAX_SIZE",1048576); // max 1 mb
$mysize=$_FILES["value_licenza_istituto_1"]["size"];
if($mysize > MAX_SIZE && MAX_SIZE > 0){
$values["licenza_istituto"]="";
$message = "<div class=message><<< Il file è troppo grande >>></div>";
return false;
}
// ok, va bene
$ext = explode(".", $values["licenza_istituto"]);
$ext = strtolower($ext[count($ext)-1]);
if ($ext <> "pdf")
{
$message = "<div class=message><<< Il file che stai cercando di inserire non è un pdf >>></div>";
return false;
}
return true;
to upload files to users folders. The upload works fine. But unfortunately:
- i can't delete the file when i update the record with a different pdf;
- i can't reach the file with the default link present in the list page;
- i can't add/edit records inline;
- after adding a record i can't see/edit the record with the link present in the message box (the value of the variable editid1 is empty).
IMHO all these drawbacks are related to the fact that the pages generated with phprunner can't see the uploaded file in it's custom directory.
Do you have any suggestions?