Forum Moderators: coopster & phranque

Message Too Old, No Replies

CGI_Lite 2.0 and Image::Magick problem

Has the uploaded image been written?

         

bobriggs

6:30 pm on Jul 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm using CGI::Lite and Image::Magick to take form input to receive a file, then Magick to manipulate it.

CGI::Lite is just reading in the parameters of a multipart/form-data post, and it saves the binary image uploaded (in this case a jpg image) to a location which I've specified.

After that returns, I am using Image::Magick to scale the image down to a thumbnail size.

This works about 60% of the time. I'm getting an error message from the Image::Magick module saying that the file is corrupt or incomplete, but when I check the file, it is ok (after a period of time).

So is CGI::Lite spawning a program to save the file and returning immediately? In other words, the job of saving the file is not complete, and Image::Magick is the next in line to manipulate the file, and it's not ready - so that's the error?

If it is, how can I ensure that the write of the file (jpg) is complete before using Magick on it?

Anybody had any experience with this before?

bobriggs

1:14 am on Jul 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't you hate it when someone replies to their own post?

I think I've got it. The problem is Opera, even though I think Opera is RFC compliant on this one, so really the problem is the CGI::Lite module (and many others that aren't expecting what Opera is submitting) I'm using Opera 6.0, and I think the problem dates back as far as 5.12.

I uploaded 50 files in a row in MSIE without a hitch.

Even NN4.08 didn't pose a problem.

Opera works only about 60% of the time, it's an intermittent problem.

Just in case anyone's interested, a search on google for 'opera multipart/form-data' will show what I'm talking about - not the results that contain the security bug; look at the list.opera.com posts.