[SOLVED] Â Uploading File to custom directory |
4/2/2020 8:14:43 AM |
PHPRunner General questions | |
![]() I'm using the following code in PHP expression: $folder = "files/clients/".$data['clientid'];
|
|
![]() |
Sergey Kornilov admin 4/2/2020 |
You cannot $data['clientid'] or anything like this. Files are uploaded before the record is created so on the Add page we won't know what field hold which value. |
![]() |
need2sleep authorDevClub member 4/2/2020 |
That totally makes sense. I guess I was thinking in the edit section when the clientid is already created. |
![]() |
Sergey Kornilov admin 4/2/2020 |
This can be done. You can use an event like ProcessRecordValues of the Edit page to save clientid to some session variable and then use this session variable in the custom folder expression. |
![]() |
need2sleep authorDevClub member 4/2/2020 |
Wonderful thank you. I should have started in the edit section first. $_SESSION["UpFolder"] ="files/client/".$values['clientid']."/"; |