Upload_Dir

QuestionsUpload_Dir
Georges asked 3 days ago

Hi

 

question about Upload_Dir

for example can I changeĀ $col[“upload_dir”] = __DIR__.”/DATA

to add an extra information coming from other field

example if field ‘Customer’ = 12 then upload dir

$col[“upload_dir”] = __DIR__.”/DATA/12

 

I tried to create a specific field for Folder but I can’t user it

ex: $col[“upload_dir” = $data[“Folder”];

 

Maybe it’s not possible

 

Regards

 

Georges

 

1 Answers
Abu Ghufran Staff answered 2 days ago

You can do it with on_insert OR on_update event handler where you can move the uploaded file to the desired folder.

For sample code, refer to this code: https://www.gridphp.com/demo/demos/editing/file-upload.phps

Line 153-156: event handlers
Line 180: move the file to desired folder

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

19 + 2 =

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?