CHMOD folder for web upload & FTP?

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
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

CHMOD folder for web upload & FTP?

Post by tsg »

I have been working on a file manager for a client where he can upload files, create folders, etc. Works great. BUT, I have the main folder CHMOD at 777 and when the scripts creates a folder, it CHMOD at 777.

My problem is now I can not FTP anything in to those folders. "Permission Denied" (sounds like my ex-wife).

So, how can I CHMOD so where I can upload from a form on the web AND FTP??

Thanks
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

if the folder attribs are 777 you should be able to upload and ftp in, are the folders outside of your ftp home folders path? if so this would prevent you from ftping into them.
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

Post by tsg »

I did a lot of research and find out that it is a bug or something in PHP. I added a chmod line to my code and works perfectly now ..

mkdir("$path/$folder/$new_folder", 0777);
chmod("$path/$folder/$new_folder", 0777);

Maybe this will help someone down the road.
Post Reply