Multiple local files processing

See all posts Reply

Multiple local files processing new!
by imgrby, 13 years, 9 months ago
how to process multiple local files?
another script sends local files paths to form.php and it builds required number of fields. but actions "multiple" or "local" aren't useful for multiple local files processing.
what should i change to make upload.php process multiple LOCAL files?Reply
Re: Multiple local files processing new!
by colin, 13 years, 9 months ago
Please check the FAQ, the question What about multiple uploads?.

Or search the site for multiple uploads.Reply
Re: Multiple local files processing new!
by imgrby, 13 years, 9 months ago
it's NOT multiple upload! it's local files processing.
when you UPLOADS multiple images - field type is "file", when it's local files - field type is "text" and first code part of FAQ example cannot work with &_FILES['my_field']Reply
Re: Multiple local files processing new!
by colin, 13 years, 9 months ago
Sorry, I misread your post.

In order to process multiple local files, you need to do a loop around the class instantiation:
foreach ($files as $file) {
  $handle = new upload($file);
  .....
}
Reply
Re: Multiple local files processing new!
by imgrby, 13 years, 9 months ago
okay, looks like step ahead.
now in both of two files it says:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(//2011.02/DSC07055.jpg) is not within the allowed path(s): (/home/imgrbyin/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/share/pear/:/usr/home/tmp) in /usr/home/imgrbyin/domains/imgrby.ehost.by/public_html/class.upload.php on line 2443
-------
i checked - files exists. didn't edit class.upload.phpReply
Re: Multiple local files processing new!
by colin, 13 years, 9 months ago
Before instantiating the class with your file, you need to move it to a location allowed by open_basedir. Check the PHP on how to do that. But basically, you can do it only with move_upload_file, as it is the function which allows you to access a file protected by open_basedir.

In fact, if the class is directly receiving the form, then it will automatically use move_upload_file for you. I am not sure why you need to have another script calling a second script. But doing so, you need first to move the files before you can process them as local files.Reply
Re: Multiple local files processing new!
by imgrby, 13 years, 9 months ago
another script uploads multiple files with one button(can select multiple files in dialog window - because i don't know how many files i'll upload each time).

is there any possibility in class upload to select multiple files with one field?Reply
Re: Multiple local files processing new!
by imgrby, 13 years, 9 months ago
upd: no errors. now i need to understand why it's not resize imagesReply
Re: Multiple local files processing new!
by imgrby, 13 years, 9 months ago
upd: everything soleved and works about to perfect!
thanx colin and thanx to developers - very good engineReply
Re: Multiple local files processing new!
by colin, 13 years, 9 months ago
Glad you got it working.

Colin and the developers are one same person: me... :)Reply