warning: imagejpeg() [function.imagejpeg]: Unable to open 'sites/default/files/imagefield_thumbs/tmp/Gulf_Oil_Spill_Leak81_0.jpg' for writing: No such file or directory in /home/spillbab/public_html/sites/all/modules/imageapi/imageapi_gd.module on line 66.

What to do about this? This is holding up the launch of a website I'm building.

Comments

Anonymous’s picture

hi ray,

just wondering if you managed to get this working in the end? i too am getting this error when i try and upload a image with gallery views.

this is the full error message:

warning: imagejpeg() [function.imagejpeg]: Unable to open 'sites/default/files/imagefield_thumbs/photos/name_of_file.jpg' for writing: Permission denied in /path/to/my/drupal-site.co.uk/sites/all/modules/imageapi/imageapi_gd.module on line 66.

i've set the permissions to 777 on sites/default/files so i'm not sure why it's complaining about read/write access. i'm going to roll back imageapi and see if that helps. if anyone out there can throw me a line i'd really appreciate it.

cheers,

simon.

eff_shaped’s picture

Getting similar error:

warning: imagejpeg() [function.imagejpeg]: Unable to open 'sites/example.com/files/imagefield_thumbs/P1000808.JPG' for writing: Permission denied in /home/example/public_html/sites/all/modules/imageapi/imageapi_gd.module on line 66.

Uploading images to multisite installation with CCK image field.

image api 6.x-1.8
ImageCache 6.x-2.0-beta10
ImageField 6.x-3.3
cck 6.x-2.6
Drupal 6.16

Looking for solution and will report back.

pamster’s picture

Priority: Critical » Normal

Ray/people: check out your imagefield_thumbs/tmp folder. It may not exist or have appropriate permissions.

Ray Seaman’s picture

Pam has it right - you have to make sure you have the right permissions for the appropriate folders.

eff_shaped’s picture

That's good to know.

Can anyone say where the imagefield_thumbs/tmp folder is supposed to be?

thanks pam and ray

artofeclipse’s picture

I have faced the same problem

you must create the folder to look like this site/default/files/imagefield_thumbs/tmp

and change the owner to www-data or the "apache user"

krush360’s picture

I have done all the above prescribed steps and am still receiving the same error message originally referenced in this thread. This only happened after we migrated the drupal cms from a shared hosting account to a virtual dedicated server. The error message is generated when attempting to upload an image to be associated with a product using the ubercart module. Error is as follows:

warning: imagejpeg() [function.imagejpeg]: Unable to open 'sites/default/files/imagefield_thumbs/tmp/krush.jpg' for writing in /home/krush1/public_html/modules/imageapi/imageapi_gd.module on line 66

So I created the 'tmp' directory '/sites/default/files/imagefield_thumbs/tmp' with adequate permissions and am now getting the following error:

warning: imagejpeg() [function.imagejpeg]: Unable to open 'sites/default/files/imagefield_thumbs/krush.jpg' for writing in /home/krush1/public_html/modules/imageapi/imageapi_gd.module on line 66

Using Simple Control File to manage files, the permissions reflected are correct. What is wrong?

krush360’s picture

marvil07’s picture

Title: When I Try and Upload An Image I Get This Error » warning: Unable to open X for writing: No such file or directory in Y
Status: Active » Fixed

@krush360: It sound like you have changed the permissions for sites/default/files/imagefield_thumbs/tmp/ but not for sites/default/files/imagefield_thumbs/. Please make sure you have done that.

BTW changing title to be a little more descriptive.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dhcp’s picture

I changed the owner and group to the apache user and it resolved my problem. Thanks!

CowTownFarmBoy’s picture

Having the same problem and am new to LAMP how did you change the ownere and group to the apache user?

Did you run something like

sudo chown apache -R imagefield_thumbs

while in the files/ directory

Thanks...

dhcp’s picture

I did it on a linux server and here is the command I used after logging in, changing to the root user and changing to the site's '/sites/default/' folder.

chown-hR apache:apache files

It changed the owner and group...and then I made sure the permissions were 755.

Hope that helps.

carlclancy’s picture

after you've changed your folder permissions you may need to "flush all caches" before the issue is fixed.