Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP uploading files to a protected (.htaccess) area

Status
Not open for further replies.

csbdeady

Programmer
May 18, 2002
119
GB
Hi there

I've protected something like mysite.com/subdir/ with .htaccess

In mysite.com/myfile.php I have a line which uploads a file to mysite.com/subdir/ .

When I run the PHP program I get:

Warning: Unable to create 'mysite.com/subdir/buscard10.PDF': Permission denied in /var/ on line 201
Problem: Could not move file into directory

Line 201 does the upload (as you can guess from the above).

How do I a username and password in myfile.php to allow access to this protected directory?

Thanks!
-Colin
 
Are you uploading or are you moving the file? If the latter, change the permissions of subdir to 777, or at least write permissions for the user Apache runs as. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top