Changing asp net temporary files folder location

Changing ASP.NET Files Folder Location

ASP.NET is a popular programming language used for building web applications. One requirement in ASP.NET development is to change the location of the temporary files folder. By default, ASP.NET stores temporary files in a folder named “Temporary ASP.NET Files” located in the Windows directory. However, there may be situations where you need to change this location to a different folder.

To change the temporary files folder location in ASP.NET, you can follow these :

Step 1: Create a New Folder

First, you need to create a new folder where you want to store the temporary files. This folder can be located anywhere on your system, but make sure it has appropriate permissions for the ASP.NET process to read and write files.

Step 2: Update Web.config File

Next, you need to update the Web.config file of your ASP.NET to specify the new temporary files folder location. The Web.config file is a configuration file that contains various settings for your application.

Open the Web.config file in a text editor and locate the element. Inside this element, add the following attribute:

Replace “path/to/new/folder” with the actual path to the new folder you created in Step 1. Make sure to use the correct path format for your operating system (e.g., backslashes for Windows).

Step 3: ASP.NET Process

updating the Web.config file, you need to restart the ASP.NET process for the changes to take effect. You can do this by restarting the web or recycling the application pool associated with your ASP.NET application.

Once the ASP.NET process is restarted, it will start the new temporary files folder specified in the Web.config file.


Here is an example of how the updated Web.config file would look like:


In this example, the temporary files folder is set to “C:MyTempFolder”. to replace this with the actual path to your new folder.

By following these steps, you can easily change the location of the temporary files folder in ASP.NET. This can be useful in scenarios where you want to store temporary files on a different drive or partition, or if you have specific security or performance requirements.

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents