file-upload-and-visualisation

Questionsfile-upload-and-visualisation
Ced asked 4 hours ago

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

1 Answers
Ced answered 4 hours ago

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

Your Answer

14 + 13 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?