M
Mark Denardo
This is related to another post I submitted, but I'll be more precise this
time.
I have a web page that contains an Image webcontrol that loads its image by:
Image1.ImageUrl="<username>.jpg", and an option for the user to update the
photo. If they click the update button, I then flip up a new panel, where I
have a FileUpload control and corresponding Upload Button. If they load an
image file and click the Upload button, my code uses the
FileUpload1.SaveAs(...), saving to "<username>_temp.jpg", and then load the
image in another Image control (Image2) that I use for a preview area for
the user. They can re-upload as many preview photos they want and each time
the FileUpload1.SaveAs(...) command saves the image to "<username>_temp.jpg"
and the preview image always updates correctly. But when the user clicks
the final "Save Image" button to return to the original panel, I'm left with
their latest photo named "<username>_temp.jpg", which I then save as
"<username>.jpg", and re-update the original Image control (Image1). The
problem is, the original Image control, still keeps pointing to the cached
Image I loaded when the page originally loaded.
So my question is, how do I dynamically (in code) delete the temp image file
that's being held in cache or cause it to expire so that the new photo gets
updated. When I use the "FileUpload1.SaveAs(...)" command, it is doing
something somehow to make my preview Image control work properly.
Any help?
time.
I have a web page that contains an Image webcontrol that loads its image by:
Image1.ImageUrl="<username>.jpg", and an option for the user to update the
photo. If they click the update button, I then flip up a new panel, where I
have a FileUpload control and corresponding Upload Button. If they load an
image file and click the Upload button, my code uses the
FileUpload1.SaveAs(...), saving to "<username>_temp.jpg", and then load the
image in another Image control (Image2) that I use for a preview area for
the user. They can re-upload as many preview photos they want and each time
the FileUpload1.SaveAs(...) command saves the image to "<username>_temp.jpg"
and the preview image always updates correctly. But when the user clicks
the final "Save Image" button to return to the original panel, I'm left with
their latest photo named "<username>_temp.jpg", which I then save as
"<username>.jpg", and re-update the original Image control (Image1). The
problem is, the original Image control, still keeps pointing to the cached
Image I loaded when the page originally loaded.
So my question is, how do I dynamically (in code) delete the temp image file
that's being held in cache or cause it to expire so that the new photo gets
updated. When I use the "FileUpload1.SaveAs(...)" command, it is doing
something somehow to make my preview Image control work properly.
Any help?