Re: Help required... Simple File Upload

From: Date: Mon, 25 Nov 2002 07:28:18 +0000
Subject: Re: Help required... Simple File Upload
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-17104@lists.php.net to get a copy of this message
$file = $_FILES['userfile']['tmp_name']; print_r($file . "<Br>"); print($_FILES['userfile']['size'] . "<br>"); move_uploaded_file($file, "/Uploads"); /* gives the following output d:\raheel\w3sites\phpDE.tmp 73699 */ /* $file = $_FILES['userfile']['tmp_name']; print_r($file . "<Br>"); print($_FILES['userfile']['size'] . "<br>"); move_uploaded_file($file, "d:\\raheel\\w3sites\\txtfiledemo\\uploads\\"); give the following output d:\raheel\w3sites\phpE3.tmp 73699 Warning: Unable to create 'd:\raheel\w3sites\txtfiledemo\uploads\': Permission denied in D:\Raheel\W3sites\txtfiledemo\default2.php on line 25 Warning: Unable to move 'd:\raheel\w3sites\phpE3.tmp' to 'd:\raheel\w3sites\txtfiledemo\uploads\' in D:\Raheel\W3sites\txtfiledemo\default2.php on line 25 */ "J.Veenhuijsen" <info@solid-digital.nl> wrote:Try move_uploaded_file() with full pathname. Jochem Raheel Hussain wrote: > > /* > i m now using the following script to upload the file but > still it is not working.. > I there would've been some permission problem , i have given > "full control" permission to the whold directory even the drive there > the site is hosted. > now the script is generating the following out put > which means that the file is uploaded successfully. as the error code is > zero, but when i see the uploads directory it is still empty > */ > $file = $_FILES['userfile']['tmp_name']; > print_r($file . " "); > if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { > print("[" . $_FILES['userfile']['error'] . "] : is the error > code"); > copy($file, "/uploads"); //a directory whose name is Uploads on the site root > } else { > echo "Possible file upload attack. Filename: " . > $_FILES['userfile']['name']; > } > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now

« previous php.windows (#17104) next »