$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" <[EMAIL PROTECTED]> 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