Last post Apr 18, 2006 03:10 PM by jbat1
Mar 31, 2006 08:07 AM|Minaki|LINK
I have the following code to resize an image and then save the resized image...
// Save the image from the form input
The very last line, that deletes the temp image, always causes an exception because the file temp.jpg is still in use. There are two ways I can see of getting around this issue. The one I would like to use is loading the image
directly into the image object from the form input without saving it as a temp file first. Is this at all possible?
Failing that, how could I free up the temp.jpg image so that I can delete it?
Apr 12, 2006 04:55 PM|jbat1|LINK
I'm having this >>exact<< same issue.
My idea was to set a process on the thread, that ran every 12 hours to clean out images, until a friend pointed out that this could be bad if someone wanted to do a DOS by uploading TONs of images.. etc. etc.
Anyone have any ideas how to deal with this? I thought the Dispose() method was supposed to release the processes attached to the object?
Apr 12, 2006 05:35 PM|Minaki|LINK
Got it. No idea why I didn't see this before... it's so simple!
The image can be loaded directly into the Bitmap object using a stream:
bmpOriginal = new System.Drawing.Bitmap(fuImage.FileContent);
That way, you don't need to save a temp file.
Apr 18, 2006 03:10 PM|jbat1|LINK