Reply to I have problems with multiple upload

I have problems with multiple upload new!
by Alex, 11 years, 1 month ago
require'class.upload.php';

$files = array();
foreach ($_FILES['image_field'] as $k => $l) {
 foreach ($l as $i => $v) {
 if (!array_key_exists($i, $files))
   $files[$i] = array();
   $files[$i][$k] = $v;
 }
}

foreach ($files as $file) {
  $handle = new Upload($file);
  if ($handle->uploaded) {
    $handle->Process("C:\Users\ALEX\Desktop\images");
    if ($handle->processed) {
      echo 'OK';
    } else {
      echo 'Error: ' . $handle->error;
    }
  } else {
    echo 'Error: ' . $handle->error;
  }
  unset($handle);
}


This is the code that i'm using for the upload.php file
When i upload an image it says Warning: Invalid argument supplied for foreach(), and it is this line of the code foreach ($l as $i => $v)

What should i do ?Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important