Problem using Imagecache to upload images in Stories

macuhail - February 7, 2008 - 15:36

For some reason imagecache will not upload an image via an image field I have created to be used in story content types. I can see the thumbnail preview when I upload the image on the story creation form. However, the image is not uploaded when I submit the story and I get the red X field.

This seems to be related to some issue with the image storage path. When I add a subdirectory to the files directory (when configuring imagecache) and try to save it, I get an error that says the subdirectory does not exist. This happens even if I change permissions to 777 on both the files and the subdirectory.

Any suggestions to fix this?

Thanks

change permissions on your folders

plutado - February 7, 2008 - 15:44

macuhail, you'll probably need to change the folder permissions on the folder that imagecache uses to upload your images. Imagecache generally creates these folders automatically. You may have to erase the folders that are created automatically, and then manually create the folders and then chmod the folders to 777.

I have also found that the upload button can be a little buggy. If you simply browse to the file you want to upload, and then submit the story node, the image will upload as soon as you hit the submit button.

I hope this helps!

plutado, I think this is

macuhail - February 7, 2008 - 22:52

plutado, I think this is close to identifying the problem. It looks like image cache will create the folder tree imagecache/main/files. in the main files directory. However, if I leave the file path blank in the form to create the field, it will store the image in the main files directory then look for it in the files/imagecache/main/files directory.

It will not allow me to enter the path imagecache/main/files into the path field in the form.

Any idea how to override this?

hope this helps.

plutado - February 8, 2008 - 16:07

leaving the field blank will automatically default the upload into the imagecache directory (in your case, files/imagecache/main/files). there isn't a need to override this in the field. however, now since you know the folder structure that is created by imagecache, you should erase [or simply rename] those folders that are automactically created by imagecache, and then recreate them yourself - the difference being that you'll be able to assign the 'files' folder [files/imagecache/main/files], write permissions of 777. you'll see that when this folder is created by the imagecache module, it's given the permissions of 775. When I use imagecache, I generally create the folders that are going to be used manually before I actually create the imagecache profile.

 
 

Drupal is a registered trademark of Dries Buytaert.