Search code examples
c#asp.netihttphandler

Remove viewed Files from PC using IHttpHandler


Is there any way to remove the viewed Documents/Images from PC with apsx? In my IHttpHandler i tried:

context.Response.Cache.SetNoStore();
context.Response.Cache.SetCacheability(HttpCacheability.NoCache);

In Firefox the temp Files are saved in C:\Users\username\AppData\Local\Mozilla\Firefox\Profiles\jwhjrpy1.default\cache2\entries

I don't want to delete everything, but only the files that are opened with the aspx application.


Solution

  • You can't prevent saving content on the client. Even if you don't cache the file, it is still possible to download the file, and most browsers do this automatically.

    Then the file is outside the control of the browser.