WTF uploads :)

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
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

WTF uploads :)

Post by alex.barylski »

I'm getting this error:

Code: Select all

The file "test.pdf" could not be uploaded: Unable to move '/tmp/phpnJFXY2' to '/home/virtual/site116/fst/var/www/html/owners/test.pdf'.
Everything uploads into the /html directory fine, but /html/owners throws this error???

Permissions in /owners is 775 so I'm sure it's not that...any ideas?
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Post by Mightywayne »

Have you turned it to 777 just to be sure?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

My bad, I should have checked...thanks :)

Not sure I'm comfortable with that as a fix, but whatever :P
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You could FTP the files instead. :P
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Yeah, I'm not a big proponent of leaving my filesystem 777. Especially when allowing uploads. Is FTP not an option?
SteveMellor
Forum Commoner
Posts: 25
Joined: Mon Jun 26, 2006 7:43 am

Post by SteveMellor »

You could (and I am thinking not only outside the box but quite far away from the whole package) have your upload script:
  • Target the directory you want to upload to
    CHMOD it on the fly
    Upload the file
    CHMOD back
But that is overkill I think and I'm not sure it would work on some servers.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

AFAIK if you don't have the permission (via PHP) to upload files to a 755 folder then you won't have permission to CHMOD the folder to 777 either; it wouldn't make sense.

timvw (or anyone) is probably alot better to ask about something like this than me.
Post Reply