I created a new ImageField and tried to upload an image which is valid image, but it refreshes the page and says
"The Image upload failed."

When I look into the "recent log entries"
Type: imagefield
Date: Monday, November 24, 2008 - 14:30
User: kishore
Location: http://localhost/drp66/filefield/ahah/article/field_promo_image/0
Referrer: http://localhost/drp66/node/11/edit
Message: The file upload failed. field_promo_image_0
Severity: notice
Hostname: ::1
Operations:

Can anyone let me know what might be the issue ? or what might went wrong ?

Drupal Version: drupal-6.6.tar
Filefield Version: filefield-6.x-3.0-alpha5.tar
ImageAPI Version: imageapi-6.x-1.0.tar
Views Version: views-6.x-2.1.tar
CCK version : cck-6.x-2.1.tar
imagefield version : imagefield-6.x-3.0-alpha2.tar
permissions for your tmp and files directory. : drwxrwxrwx 11 root wheel 374 Nov 24 14:29 tmp
download method (public or private files) : public
imagefield configuration : all defaults + all max size 8M
expected results : Image to be uploaded without any issue.
the unexpected actual results : "The Image upload failed." error appears, and doesnt upload the image
Steps to reproduce the problem. : above mentioned.

Comments

kishorevaishnav’s picture

Status: Active » Closed (fixed)

Its been solved. Thanks :-)

kramssov’s picture

To give some meaning to this - I had the same error and in my case it was the temp upload directory in php.in that was not set.

php.ini
upload_tmp_dir =/tmp

Best, Mark

jackson_vkh’s picture

What was the solution? I'm having the same problem.

jackson_vkh’s picture

What was the solution? I'm having the same problem.

mattgilbert’s picture

what was the solution? i also have the same problem

smscotten’s picture

Status: Closed (fixed) » Active

Waitaminnit... does this mean that ImageField will not work using Drupal's tmp directory but needs to use the one configured in php.ini? Many of us don't have access to php.ini (shared servers, etc).

Somehow my php.ini has upload_tmp_dir = no value and I cannot change that. It is a PHP_INI_SYSTEM value and can only be set in php.ini.

If this is indeed the issue, there must be a way around it, because all my other file uploads (the Image Picker module is the only one I can think of off the top of my head) work fine.

@jackson_vkh and @mattgilbert: the solution is in post #2 here, by kramssov. Alter your php.ini file as described.

quicksketch’s picture

There is no need to change your PHP temp directory as far as I know. What might have happened here is that Drupal will automatically use the temp directory specified by PHP unless a different directory has been specified under admin/settings/file-system. So it might have been the case that kramssov simply didn't change this value at admin/settings/file-system, but instead changed it in php.ini.

quicksketch’s picture

Status: Active » Closed (fixed)
univac’s picture

Category: support » bug
Status: Closed (fixed) » Active

ImageField does not work using Drupal's tmp directory but needs to use the one configured in php.ini.
If I change the upload_tmp_dir to something below open_basedir, it will work.

Thanks for the module which is a great stuff!

quicksketch’s picture

univac, I'm not sure what suggestion you're making. ImageField/FileField doesn't do any special uploading into temp directories any more than the rest of Drupal does (say uploading a user picture or using upload.module).

univac’s picture

hi quicksketch,

noted. I have to admit I do not know how the code is done.
nonetheless in my environment the ImageField started to work after I have modified the parameter upload_tmp_dir in php.ini.

bye
univac

quicksketch’s picture

Category: bug » support
Status: Active » Closed (fixed)
progone’s picture

follow the instructions on this page. http://drupal.org/documentation/modules/file

In the first image example at above link use the word 'image' instead of file.