Upload to different directories

See all posts See thread Reply

Re: Upload to different directories new!
by colin, 15 years, 7 months ago
You should use a hidden field for upload_dir. But really, it is a very unsecure way to do. You'd better have a list of possible directories in your form, in a select list for instance, and then in your PHP code translate the user's choice into a real directory.

In any case, this is a PHP issue, and doesn't really belong here.Reply
Re: Upload to different directories new!
by Rene Buruma, 15 years, 7 months ago
Because I am using this locally on my own PC security is no issue for me. The problem is that usingthis syntax:
$handle->Process('./jGallery/albums/$dir');

will create a new directory called $dir in stead of a new directory withteh value of $dir (for exampel 4 if I want to upload an image for bird number 4.Reply
Re: Upload to different directories new!
by colin, 15 years, 7 months ago
Simply do:
$handle->Process("./jGallery/albums/$dir");

or:
$handle->Process('./jGallery/albums/'.$dir);
Reply
Re: Upload to different directories new!
by Rene Buruma, 15 years, 7 months ago
Thanks Colin,

This works perfect. I am not a very experienced php programmer. Thanks again for your help.

ReneReply