At 10:53 AM +0800 12/4/02, Manisha wrote: >> >if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) { >> > copy($HTTP_POST_FILES['userfile']['tmp_name'], "/img"); >> >>Check to see whether that "copy" function completed successfully. > >how ? I put one echo statement after copy which is displaying but never >uploading the file.
http://www.php.net/manual/en/function.copy.php >>I'd be surprised if you really want to move the file to /img. >>And if you're on a Unix system the web server certainly won't >>have write access to the / directory. > >i tried with complete path starting from root (/usr/web..../html/img) and >also with virtual (/img/). > >Is there any extra param setting ? any access rights ? The web server must have write and execute access to the directory in which you are creating the new file. In general the web server runs with no privileges, so the directory must be world-writable. This is the reason uploaded images are generally dumped into a database. Bad news having world-writable files/directories scattered all around. Try creating the file in /tmp as a test. ...R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php