Jump to content

Recommended Posts

I have a script which succesfully changes the permission of jpg files and moves them to another folder. The strange thing is that even though the script works perfectly it gives me the following errors for each file moved:

Warning: chmod(): Operation not permitted in...

Warning: rename(...

I don't understand why the error messages are being generated if the script works.

Any ideas?
Link to comment
https://forums.phpfreaks.com/topic/14672-file-permissions-mystery/
Share on other sites

what exactly are you working on?  I suppose some sort of file uploading mechanism.

Normally, I'd set the permission for destination folder to world writable.  Of course, no change need to make to source folder.

So, that'd left you with 2 choices, should you set it to writable, or set it to writable, move the file, then set it back to readonly.

easy choice would be set the folder to writable.
the second choice need a little more work.  The idea is using php to create a connection to your ftp server using your username and password.  With this, you gain full access to your site, and you can change the destination folder to writable, move the file, then change back to readonly.

I have worked on similar problem, and as far as I've known, there is no other way unless you have control over PHP installation.


This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.