Hi
I'm using the following code to try to upload a file (testing it on localhost IIS at the moment)
For some reason it isnt acknowledging the file exists when it is submitted.
my html is
<form name="frmUpload" id="frmUpload" action="index.php" method="POST" enctype="multipart/form-data">
<input type="file" name="userfile" style="width:100px;border:1px solid #CCCCCC;height:17px;margin:0px;" />
<input type="hidden" name="uploadfileflag" value="upload" />
<input type="submit" name="Submit" value="Submit" />
</form>
and my php to recieve this is:
if (isset($_POST['uploadfileflag'])) {
$File = $_POST['userfile'];
if (copy ($File, "$Filename")) {
print ("Your file was sucessfully uploaded!\n");
} else {
print ("Your file, $Filename, could not be copied.\n");
}
unlink ($File);
}//end if isset
I am unable to work out why this fails!
If anyone could help me out that'd be great. cheers