0

I'm working on a legacy .NET project. As per the new requirement I'm trying to save the uploaded jpg files for some processing. So I'm getting the executing assembly and create a temporary folder to store images. My question is the ExecutingAssembly returns something like "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ApplicationName" but still I can store and and process jpg files in that folder. So is it ok to store files in "Temporary ASP.NET" folder. Will it cause any problem?

Note: The stored images will be deleted after doing some process and don't need to be retained

Jay
  • 41
  • 7
  • According to [this answer](https://stackoverflow.com/a/450912/43846), _"ASP.NET watches for file changes in [this folder] and will if necessary begin the whole process all over again."_ but if it works for you, I guess ASP.Net doesn't think a new image requires the process to be restarted. – stuartd Oct 12 '20 at 13:32

1 Answers1

0

This folder is used to cache the compiled assembly. When the user requests resources from the website, the web page will be dynamically compiled, and then cached in this folder. When there are subsequent user requests, the resources can be directly obtained from the cache instead Compile again.

More information can be found in Understanding ASP.NET Dynamic Compilation

So it can be said with certainty that if the image you want to process does not need to be stored permanently or destroyed after processing, it can be stored in this folder. Similarly, the contents of the folder can also be deleted, which will not affect your application, but it needs to be recompiled when users request resources, which may take a little longer.

Bruce Zhang
  • 2,880
  • 1
  • 5
  • 11