Hello, I am trying to upload each files of a row to a specific folder. I want the folder to be dynamic with the id number at the end. something like: $uploaddir =\’SDS\’.$id; $col[\”upload_dir\”] = $uploadDir; // upload here I then have 2 questions, In edit mode how to get the current Id passed to the upload_dir In add mode how to upload to temp, create the row and then move to the file to the correct folder? I have thought about something like this but I can\’t make it work: $editedRequestId = isset($_POST[\”sds_r_id\”]) ? (int) $_POST[\”sds_r_id\”] : 0; // Edit -> existing request folder ; Add -> temporary folder (no DB id yet) $uploadDir = $editedRequestId > 0 ? get_sds_request_folder($editedRequestId) : $sdsBaseDir . \”/TEMP\”; if (!is_dir($uploadDir)) { mkdir($uploadDir, 0775, true); } Also how to have a column that will list all the uploaded files? What type of field should we use in the db? Thanks, Ced
I want the folder to be dynamic with the id number at the end. something like:
$uploaddir =\’SDS\’.$id;
$col[\”upload_dir\”] = $uploadDir;
I then have 2 questions,
In edit mode how to get the current Id passed to the upload_dir
In add mode how to upload to temp, create the row and then move to the file to the correct folder?
I have thought about something like this but I can\’t make it work:
$editedRequestId = isset($_POST[\”sds_r_id\”]) ? (int) $_POST[\”sds_r_id\”] : 0; // Edit -> existing request folder ; Add -> temporary folder (no DB id yet)
$uploadDir = $editedRequestId > 0 ? get_sds_request_folder($editedRequestId) : $sdsBaseDir . \”/TEMP\”;
if (!is_dir($uploadDir)) { mkdir($uploadDir, 0775, true); }
Also how to have a column that will list all the uploaded files?
What type of field should we use in the db? Thanks, Ced

