Denied File Upload

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ace2600
Forum Commoner
Posts: 30
Joined: Fri Jun 21, 2002 12:12 am

Denied File Upload

Post by ace2600 »

When trying to upload a file through a form I get the following error:
Unable to create '/home/ranchsal/public_html/images/finalcdLogo.jpg': Permission denied in /home/ranchsal/public_html/test.php on line 49
The problem seems to come from this line "if (!copy($imgfile,"$newfile"))"
I copied the code from this site(which is helpful), so it should work. Why am I getting this error, does it have to do with my host? And more importantly how can I fix it. Heres a link to my site.Thank you!
-Ace
You can email me to for clarifications or more code at ace2600@hotmail.com
kaizix
Forum Commoner
Posts: 50
Joined: Tue Jun 18, 2002 9:16 pm
Location: california
Contact:

Post by kaizix »

you may have the chmod the directory images so that the server can write to it. 666 should do it i think.
Fábio Selinger
Forum Newbie
Posts: 7
Joined: Wed Jul 17, 2002 3:21 am
Location: Porto Alegre/RS

...??

Post by Fábio Selinger »

i have the same problem, and i used chmod but ...
warning chmod failed:Operation not permitted
what do i do?
kaizix
Forum Commoner
Posts: 50
Joined: Tue Jun 18, 2002 9:16 pm
Location: california
Contact:

Post by kaizix »

that means it's a windows server.....if it's a webhost (and not your own computer) you'll have to get your host to change the permissions on the dir.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Fábio - please don't cross post.
Could anyone responding to him please do so here:
http://www.devnetwork.net/forums/viewtopic.php?t=1627

Mac
Post Reply