note 10781 rejected and deleted from Handling file uploads by zak

From: Date: Mon, 22 Jan 2001 20:03:10 +0000
Subject: note 10781 rejected and deleted from Handling file uploads by zak
Groups: php.notes 
Request: Send a blank email to php-notes+get-10071@lists.php.net to get a copy of this message
error: Warning: Unable to open 'C:testtest.exe' for reading: No such file or directory in /home/admin/index.php3 on line 19 line 19: copy($userfile, $filepath); index.php: &lt;?php if (!$upload) { print( "<FORM ENCTYPE="multipart/form-data" ACTION="index.php3" METHOD=POST>". "<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="2000000">". "<INPUT TYPE="hidden" name="acctid" value="upload">". "<INPUT TYPE="hidden" name="pgid" value="members">". "File:<br><input type="file" name="userfile"><br>". "<input type="submit" name="upload" value="Send">" ); } else { if ($userfile == "none") { print ("No file was uploaded, or file was of 0 length."); } else { $userfile=htmlentities(stripslashes("$userfile")); $file=basename($userfile_name); $filepath="content/upload/files/"; $counter=0; copy($userfile, $filepath); print( "<b>File Uploaded!</b><br>n". "<b>File Name:</b> $file<br>n". "<b>File Size:</b> $userfile_size<br>n". "<b>File Type:</b> $userfile_type<br>n" ); $image_types=array( "image/gif" => true, "image/jpeg" => true, "image/pjpeg" => true ); if ($image_types[$userfile_type]) { print( "<b>Image Preview:</b><br>n". "<img src="".$filepath.$file."">n" ); } } } ?> </FORM>

« previous php.notes (#10071) next »