Invalid argument supplied for foreach()
Posted: Mon Nov 06, 2006 12:06 pm
Hi, I'm using the following code in a multiple file upload,
it used to work, but i moved servers and now i get an error in the foreach area:
Warning: Invalid argument supplied for foreach()
Any ideas? The form is multi-part, in case that was a thought.
it used to work, but i moved servers and now i get an error in the foreach area:
Warning: Invalid argument supplied for foreach()
Code: Select all
//START IMAGE UPLOAD
$path = $_SERVER['DOCUMENT_ROOT']."/it/files/".$issueID;
if(!is_dir($path)) { //if $path isn't a dir
mkdir($path, 0755); //create it
}
foreach( $HTTP_POST_FILES as $aFile )
{
copy ($aFile['tmp_name'], $path."/".$aFile['name'])
or die ("");
}