Uploading files with the the file manager : error mesage (permissions)1 user found helpful
Before I begin, I'd like to say that I am now bald, I haven't had any sleep in the last 4 days and I did search this forum for solutions before I posted... Many info on this subject but nothing would work on my site...
I "sometimes" get this error message when trying to upload files via the file manager :
"Unable to copy file to storage directory. Please check permissions on your upload directory and ensure they can be written to by your web server."
Sometimes, the file will upload, sometimes it won't... Sometimes it will after 3 times I try... When doing a multiple upload, some files will upload, others won't...
I recently did many thing to my site :
1- I migrated to a new server.
2- The migrations instructions were not to clear on certain aspect so I had to do as best as I could, with my limited knowledge...
3- I tried to repair permissions of many files and folders
4- I made sure with my server admin that the PHP safe mode was off. It is...
5-I uploaded to the latest version of concrete5.
I now I'm not giving much to work with... But this is all I've got... I'm a total newb, eager to learn though...
Thanks for your help
Files are uploaded across a fairly random set of folders & subfolders.
- Keep notes of which folders the uploads were refused for and which they were accepted for.
- Does that correlate with any differences in the permissions of the folders (755, 777 etc...)?
hum, and how can I do that?
For failed files, if you don't get the file path from the error message you could temporarily hack the uploader where the error is generated to append the path to the message or output it to the log (depends how happy you are hacking php). In fact, if you were hacking the php to add diagnostics, you could report what permissions were found as well.
I cannot possibly do that... In fact I'm thinking about deleting everything and starting from scratch...
It seems to me the best solution to ensure everything is OK again...
A lot of work, but work I know how to do :)
Browse the permissions of the /files folder and any subfolders and look for anomalies in the permissions, or try just setting /files and all subfolders recursively to 755 (safest) or 777 (lax and not as secure).
If your problem is the same as mine was, what happens is that the new folders with random names that C5 creates are created with the wrong permissions. No matter how many times you set permissions in /files, new folders won't get those permissions.
In my case, adding this line to config/site.php fixed it: