This topic is locked

dynamic file location

11/22/2007 6:52:23 AM
PHPRunner General questions
F
Fawaz author

I've a field "upload". The users are using this field to upload their files.
But I need to setup separate uploading folders for different users.
For example:

User 1: upload directory is: /files/user1

User 2: upload directory is: /files/user2

User 3: upload directory is: /files/user3
How do I do this in PHPRunner?
Thanks,

Fawaz

Alexey admin 11/22/2007

Fawaz,
the file locations are stored in $files_move array.

So you can change values in this array in Before record updated/added event.
Also you'll need to modify $values["FileField"] there to point to new file location.

F
Fawaz author 11/22/2007

Fawaz,

the file locations are stored in $files_move array.

So you can change values in this array in Before record updated/added event.
Also you'll need to modify $values["FileField"] there to point to new file location.



Alexey,

How do I use $files_move array?
In the Visual Editor, I setup the field "upload" to be file type and I've pointed it to: "files" directory.
Now I need for each user i to upload to /files/user i directory.

Could you please provide me with sample code?

Thanks,

Fawaz

Alexey admin 11/22/2007

Fawaz,
unfortunatelly I don't have a ready to go solution for this.