Hi all,
I am trying to write code that resizes and uploads multiple image files. I have written a script that resizes and uploads a single image file, but multiple does not work.
In my input form I have:
<input type="file" name="image_field[]" multiple id="image_field"/>
In the script that processes the files I have;
if($_FILES['image_field']['name'] != ""){
include ("classes/class.upload.php");
foreach ($_FILES['image_field']['name'] as $filename) {
echo $filename.'<br/>';
$handle = new Upload($filename);
$handle->image_resize = true;
$handle->image_ratio = true;
$handle->image_y = 390;
$handle->image_x = 390;
$handle->file_overwrite = true;
$handle->image_convert = 'jpeg';
if ($handle->uploaded) {
// save uploaded image with no changes
$handle->Process('/server_root/item_images/firstimage/dcj');
}
}
}
If In echo out $filename I can see the file names selected in the form.
Can anyone provide assistance. Many thanks in advance