Presenting our March Theme, Atlantic! This is a super clean corporate flavored theme that uses almost pure CSS3 to get the job done - it's fast and responsive and search engines will love it. As...
Hello,
I am having an issue while uploading an image when creating or editing an article. The basic error message is: "The file could not be uploaded."
Environment.
The site is on a Rackspace VPS.
Amoeba theme, installed from restored snapshot/demo.
I have full control of the machine via ssh.
Fedora 15.
The image trying to go up is 65kb, .jpg.
I have been all through the directory structure setting permissions to 775 for folders and checking file permissions.
Public file system path: sites/default/files (set to apache:apache 775)
Temporary directory: sites/default/files/tmp (set to apache:apache 775)
My question is.. why is it still not working?
The error log in Drupal says its trying to write the file here: /file/ajax/field_image/und/0/form-TqNMtwC6E5TnEsSBhGW9zsztPHLPWjbRJX5A-pDFcOI
and
The upload directory public://field/image for the file field field_image could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.
The first thing is.... there is no "file" directory on the server. There is "files" under the sites/default directory... but where is this function trying to write to?
Sorry for the long message, but it seems weird that the error message is coming back with a completely different directory structure than what is already created in the install.
Thanks for your help!
Jer
Presenting our March Theme, Atlantic! This is a super clean corporate flavored theme that uses almost pure CSS3 to get the job done - it's fast and responsive and search engines will love it. As...
In a few days we will be retiring a few of our older themes, due to lack of interest and in the interest of diverting more resources to keeping our recent and more popular themes up to date - a...
Hey folks - quick note to let you know we've moved to a new server thanks to Knownhost.com. So far it seems much faster than our old one,...
Hey Jer -
If you could, switch temporarily to a core theme and see if the problem is still occurring there to eliminate the possibility this is actually coming from something right in Amoeba.. I haven't personally encountered a problem like this yet with Drupal 7, but I know that others have for varying reasons: They're covered in this lengthy thread: http://drupal.org/node/240777
The most common solutions for the problem on Drupal 6 was upping the PHP memory limit (which probably isn't your problem, considering the size of the image) and incorrect rewrite rules in htaccess (usually if the installation is running in a sub directory off the main domain).
A few times I believe this was caused by a jquery conflict as well - do you have any additional modules installed?
Thanks for your help Rob!
Your feedback kept me working on the problem until it was finally fixed. I tried enabling the Bartik theme and the same problem happened. That way we know its not the theme.
So then I thought it was the apache group permissions on the server... but that was not the issue either.
I only had 2 hours to troubleshoot this morning... so at the very last minute, I looked at the error logs in drupal once more. Heres the error: "The upload directory public://field/image for the file field field_image could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled."
Started thinking... "what the hell is public://?"
Turns out that Drupal uses this as a constant.... so the real string is: /sites/default/files/field/image
Went in and set the directories and to 755 and the sucker started working!
Thanks for the feedback Rob.. it kept me going in the right direction!
Jer