[SOLVED] Copy(); question
Posted: Mon Dec 18, 2006 2:25 pm
hello, i'm stuggling today to pinpoint why my image upload ceased to work after i switched servers.
the odd thing is, that this exact script is working in a sub-folder of the main site this script is on.
what could be causing nothing to happen? it doesn't redirect at the header(); and nothing copies.
the odd thing is, that this exact script is working in a sub-folder of the main site this script is on.
what could be causing nothing to happen? it doesn't redirect at the header(); and nothing copies.
Code: Select all
if($_POST["bpress"]=="Submit")
{
//START IMAGE UPLOAD
$path = $_SERVER["DOCUMENT_ROOT"]."/Imi/Spk_Img/";
if(!is_dir($path)) { //if $path isn't a dir
mkdir($path, 0755); //create it
}
foreach( $_FILES as $aFile )
{
copy ($aFile["tmp_name"], $path."/".$aFile["name"]) ;
unlink ($path."/".$aFile["name"]) ;
copy ($aFile["tmp_name"], $path."/".$aFile["name"]) ;
//or die ("could not copy");
}
header("Location: viewimages.php");
exit;
}Code: Select all
<form name="form1" method="post" action="" enctype="multipart/form-data">
<input type="hidden" name="bpress" value="">
<input type="file" name="imagefile1" class="text" />
<input type="file" name="imagefile2" class="text" />
<input type="file" name="imagefile3" class="text" />
<input type="file" name="imagefile4" class="text" />
<input type="file" name="imagefile5" class="text" />
<input type="submit" name="Submit" value="Submit" class="text" />
</form>