Hello.
I have a problem with fileuploads.There are two php script.The first one gives you the possibility to choose the file which you want to upload.The next script should "upload" the choosen document.
Source Script one
<form name=upload method=post action=upload_exe.php onSubmit='return formchk();' enctype='multipart/form-data'>
<p>
<input type=submit ...>
<br>
<br>
<input type=>
</p>
</form>"
The second script looks like that
if ($userfile != "")
{
$UPLOAD = fopen($userfile,"r");
$contents = fread($UPLOAD,$userfile_size);
fclose($UPLOAD);
$SAVEFILE = fopen("/www/whatever/file/$userfile","w");
fwrite($SAVEFILE,$contents,$userfile_size);
fclose($SAVEFILE);
echo "<font face='Verdana' size='-1'>Die Datei wurde erfolgreich hochgeladen!</font>";
}
My problem is when I try to create the file via the second fopen command I get an errormessage thats says /www/whatever/file//tmp/php2364 does not exist.
The variable $userfile don´t contain the name the file I choose but same other strange stuff.So how can I get the name of the file into $userfile???
I hope somebody can help me out!