Hi,
I run a community oriented websites, where remote users/members need to be able to upload/update content in their assigned directory.
I wanted to create/borrow a php based FTP script, but the problem is that my host does not have the FTP module installed.
So, I'll have to use the HTTP based file capabilities of php. The problem here is that it seems to require that I make the directories writable (ie, 0777). I'd prefer not to allow that.
First, I am wondering if there is any way around this problem.
Next, it wouldn't be so bad if I could only have one temp directory that is writable for everyone to upload to. Then, the script could make the necassary file manipulations without requiring all the other directories to be writable.
I can't see to get my php code to work unless all directories are writable. Not cool.
Any suggestions? Thanks!
Jason
File Uploading Trouble
Moderator: General Moderators
try http://www.hotscripts.com, they have quite a few uploading scripts, not sure if they have any http based though 
coding not a problem
...ya, I've looked over various scripts (and there are some good ones).
But, coding things up is not really the problem. Rather, it is more to do with directory permissions and such. And, if php can only do file manipulation in an unsecure invironment.
All the scripts I've seen either assume the php ftp module is installed (not the case on my host), or that all directories are insecurely set to chmod 0777, which is an undesirable situation.
Jason
But, coding things up is not really the problem. Rather, it is more to do with directory permissions and such. And, if php can only do file manipulation in an unsecure invironment.
All the scripts I've seen either assume the php ftp module is installed (not the case on my host), or that all directories are insecurely set to chmod 0777, which is an undesirable situation.
Jason
what do you mean with http upload?
http PUT method or what is described in http://www.php.net/manual/en/features.file-upload.php?
http PUT method or what is described in http://www.php.net/manual/en/features.file-upload.php?
upload and copy
...yes, that's what I am doing. I have a simply file upload form, and then I use copy() to copy the file to the proper directory.
But, copy() only seems to work in an unsecure environment.
Jason
But, copy() only seems to work in an unsecure environment.
Jason
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Try move_uploaded_files() instead of copy(). This function will check to make sure that the file has been uploaded via PHP's HTTP POST upload mechanism and will return false if it hasn't.
Mac
Mac