Jump to content
xisto Community
Mordent

Problem With Move_uploaded_file() Permission denied?

Recommended Posts

Warning: move_uploaded_file(images/profile/Mordent.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/mordent/public_html/withvalour/edit_image.php on line 42Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpOWVz7o' to 'images/profile/Mordent.jpg' in /home/mordent/public_html/withvalour/edit_image.php on line 42

Any ideas? The code seems fine, as it works a treat when I run it locally (on WAMPServer), but as soon as I try to run it on the server I get this horrid error. I'm guessing some weird permission problem that I have no idea how to get around.

Share this post


Link to post
Share on other sites

Just guessing. I would like to give read, write and execute permissons to everybody (user, group and others) to images/profile where the image has to be moved. Give 777 permissions first, then, if it works, try to raise the security level.

Share this post


Link to post
Share on other sites

*facepalm*...for the love of...okay, so there's me thinking that some subdirectories inherited permissions. Works an absolute treat. '757' turned out to be the magic number there.Cheers for pointing out the obvious. I have my little moments. ;)

Share this post


Link to post
Share on other sites

chmod it to g+rxs

Correct, that's also what I do, although the +s permissions could be sometimes dangerous.However, if we are talking about public servers like Xisto, the user can only use ftp clients, so he connot directly access the +s option. And the users which have ssh access here are probably jailed in a rsh sheel, i'm event not sure chmod is allowed in a restricted shell command line.

Share this post


Link to post
Share on other sites

great guys

Problem With Move_uploaded_file()

 

I had this problem and 757 sure solved it. But do you know anyways to handle security with this kind of a breach

 

-reply by ulta coder

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.