note 16122 added to features.file-upload

From: Date: Wed, 17 Oct 2001 07:14:52 +0000
Subject: note 16122 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-19026@lists.php.net to get a copy of this message
if ($REQUEST_METHOD == "POST") { /* SUBMITTED INFORMATION - use what you need * temporary filename (pointer): $imgfile * original filename : $imgfile_name * size of uploaded file : $imgfile_size * mime-type of uploaded file : $imgfile_type */ /*== upload directory where the file will be stored relative to where script is run ==*/ // $uploaddir = "."; $uploaddir = "./images"; /*== setup final file location and name ==*/ /*== change spaces to underscores in filename (damn windows!) ==*/ $final_filename = str_replace(" ", "_", $imgfile_name); $newfile = $uploaddir . "/$final_filename"; /*== move file to proper directory ==*/ if (!copy($imgfile,"$newfile")) { /*== if an error occurs the file could not be written, read or possibly does not exist ==*/ print "Error Uploading File."; exit(); } echo "Sucessfully uploaded the file"; } /*== delete the temporary uploaded file ==*/ unlink($imgfile); print("<img src=\"./images/$final_filename\">"); } } ?> This is the code which i am writting in the PHP file. My problem is that it is getting uploaded in the directory whatever path i am mentioning. but when i am seeing in the browser i mean the path of the whole where the file is kept.it displays no image.Yeah the image is getting uploaded. can u plz help me out.i am facing this for a loong time.is anyone please help me out in solving the problem. -- http://www.php.net/manual/en/features.file-upload.php http://master.php.net/manage/user-notes.php?action=edit+16122 http://master.php.net/manage/user-notes.php?action=delete+16122 http://master.php.net/manage/user-notes.php?action=reject+16122

« previous php.notes (#19026) next »