Re: Subject: Help required... Simple File Upload
| From: | Neil Smith | Date: | Sun, 24 Nov 2002 09:38:12 +0000 |
| Subject: | Re: Subject: Help required... Simple File Upload | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-17095@lists.php.net to get a copy of this message | ||
By default, your webserver doesnt have permissions to write to directories other than /tmp or /temp.
File uploads as you discovered are placed in the temp directories first, then you have to copy them to a storage directory accessible to your server - though I recommend placing it outside document root so the uploaded files can't be browsed directly.
You haven't specified the OS you are using, but I bet its win2k or NT - you need to change the permissions on this directory to allow the webserver's user or group write access to this directory and its subdirectories. (This is common on linux but should work okay on w95/98/ME because they don't have strong security settings for directory access)
Hope that helps
Neil Smith.
At 07:21 24/11/2002 +0000, you wrote:
Message-ID: <20021124072111.21572.qmail@web21206.mail.yahoo.com> Date: Sat, 23 Nov 2002 23:21:11 -0800 (PST) From: Raheel Hussain <raheelphp@yahoo.com> To: php-windows@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-33574061-1038122471=:20420" Subject: Help required... Simple File Upload hi, I got a problem in a simple file upload in a php file , i have two pages and i m writing the code here as bellow ::page1.php:: Send this file: ::default2.php:: move_uploaded_file($_FILES['userfile']['tmp_name'], "D:\\Raheel\\W3sites\\txtfiledemo\\uploads\\"); print($_FILES['userfile']['error']); :: on default2.php i have the following error, which i can't figure out :: Warning: Unable to create 'D:\W3sites\txtfiledemo\uploads\': Permission denied in D:\W3sites\txtfiledemo\default2.php on line 9 Warning: Unable to move 'c:\php\uploads\php76.tmp' to 'D:\W3sites\txtfiledemo\uploads\' in D:\W3sites\txtfiledemo\default2.php on line 9 0 --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now