Hello.
First, I should say that I'm using ASP.NET and C#.
I needed to show image on the web, which is drawn by server.
So, I draw image using bitmap and graphics and save it in Server.MapPath(imagename).
Also, image is different from all clients and I'm generating different imagename.
when client go to the web page, image is generated, for example: imagename = "123.jpg";
After client click button, image is changed(Server draw new Image), and 123.jpg file is changed, but client see same image.
So I decided to generate image with other name like: "12345.jpg" and delete old "123.jpg"
But there is a problem. After client leave web page, image will not be deleted.
I am saving Image Name with Session. I know that global.asax (like global.asa) has session_end event. (I am using C#)
How can I delete file ( File.Delete(path + imagename) ) when Session_end? Or someone may have a better Idea.
1 reply to this topic
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









