after file upload, filesize stat fails - firefox

nighthawk117 - May 1, 2009 - 19:28
Project:Image FUpload
Version:6.x-3.0-rc2
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I've used IE8 and Flash 10 on my computer to test image_fupload on my site and everything works smoothly.

However, when I try to upload the same file using Firefox 3.0.10 on Windows XP and Flash version WIN 10,0,22,87 I receive the following error:

* warning: filesize() [function.filesize]: stat failed for /tmp/nameofuploadedfile.jpg in /path/to/sites/all/modules/filefield/field_file.inc on line 152.
* The selected file nameofuploadedfile.jpg could not be saved. The file is not a known image format.

While visually everything goes smoothly, it doesn't appear that the file is actually being uploaded to my server. Any idea what's going on?

#1

grandcat - May 1, 2009 - 22:30

Some configuration things are wrong on your server. I think it's a file-owner issue. Please try to connect your server's administrator in order to fix it: php has no access to move the temp file.

#2

nighthawk117 - May 5, 2009 - 18:52

That doesn't seem to make sense, given that the same PHP code and server configuration is working fine when I test it with IE8. It seems like there's something going wrong on the client side under my Firefox, Flash configuration.

#3

jonsawyer - October 20, 2009 - 05:00

I'm getting a similar error message:

* warning: filesize() [function.filesize]: stat failed for /tmp/HPIM4412.JPG in [...]/sites/all/modules/filefield/field_file.inc on line 154.
* The selected file HPIM4412.JPG could not be saved. The file is not a known image format.

Module version is: 6.x-3.0-rc2
field_file.inc version is: // $Id: field_file.inc,v 1.33 2009/04/28 04:03:24 quicksketch Exp $

Unlike the OP, the problem occurs for me in both IE and Firefox.

The problem only occurs when I try to upload a file with an upper case file extension (JPG). When I upload a file with a lower case file extension, even though it has a mixed-case file basename, it works.

Please let me know what I can do to further diagnose this problem.

#4

jonsawyer - October 20, 2009 - 07:22

OK, after several retries, I'm not sure what's changed, but now I'm getting a popup with the following poorly formatted text. The file, error and line number buried in there look the same, however.

An error occurred.
/fupload/js/imagefield
{ "status": true, "data": "\x3cinput type=\"hidden\" name=\"num_queued_images\" id=\"num_queued_images\" value=\"0\" /\x3e\x3cinput type=\"hidden\" name=\"form_errors\" id=\"form_errors\" value=\"2\" /\x3e\x3cdiv class=\"messages status\"\x3e\nPhoto show \x3cem\x3eyyy\x3c/em\x3e has been created.\x3c/div\x3e\n\x3cdiv class=\"messages error\"\x3e\n \x3cul\x3e\n \x3cli\x3ewarning: filesize() [\x3ca href=\'function.filesize\'\x3efunction.filesize\x3c/a\x3e]: stat failed for /tmp/HPIM4396.JPG in [...]/sites/all/modules/filefield/field_file.inc on line 154.\x3c/li\x3e\n \x3cli\x3eThe selected file \x3cem\x3eHPIM4396.JPG\x3c/em\x3e could not be saved. The file is not a known image format.\x3c/li\x3e\n \x3c/ul\x3e\n\x3c/div\x3e\n" }SMTP -> get_lines(): $data was ""

I'm using multiple images per node, and it turns out that the node is getting created, sometimes with just one of the images in it. I didn't look for the page before, as after the error occurred, it left me on the create page for the node and the Save button wasn't enabled because the image list had been cleared out.

Also, the "lower case works" comment before was a red herring. I think it was an instance of the "sometimes just one image works" issue above.

#5

jonsawyer - October 20, 2009 - 09:15

OK, the major problem seems to have been that I had a Notification setting "Notify poster of own posts" enabled. I turned this off and the popups stopped. I got a clue from the SMTP reference in the popup message shown above. I was indeed getting the emails; I'd been using this to debug when the nodes were actually created (or not).

I don't think this was the only thing going on. I changed my tmp directory somewhere along the line to see if that was the problem. The popups (and email notifications) continued, so I dismissed the tmp directory as a cause. However, now I see that the text in the poorly formatted popup message changed from "stat failed" to "node created", probably when I changed my tmp directory. However, I think it was the notification itself, not the fact that the message was a success or failure message, that was causing the file upload to fail with the popup.

The bulk of the popup text, by the way, only displayed in Firefox. IE shows a popup, but with only the first two lines: "An error occurred." and "/fupload/js/imagefield".

Sorry for rambling, but perhaps this will help someone else who may have this problem someday.

Now if I could just get the filefield_paths module to work correctly and put the images where I want them...

 
 

Drupal is a registered trademark of Dries Buytaert.