Visual Studio have made the life of developer very easy by providing the powerful interfaced IDE which helps to create the applications faster than any other technology. We all remember the coding in Turbo C compiler in which the output produced is “machine level language“.

Before Visual studio 2003, the output produced by the compilers were machine level language which can be pronounced as “UnManaged code“. Machine level language compiles and run on same machine or machine having same chip or configuration but it is not sure that it will run on another machine.

After Visual studio 2003, the output produced by the compilers of C# and VB were not “machine level language”, instead it was “Intermediate Language” with some metadata info which is executed by the “Common Language Runtime (CLR)“. so we can say that output produced by the compilers of C# and VB after Visual studio 2003 is “Managed Code“.

In this article, i am going to demonstrate that how to upload the file in ASP.NET production server.

Most of the case, a developer created a code to upload the file and test it on his local machine. program runs smoothly, but as he forward the same code on production. He stuck in the file permission error as on the local he has the full permission whereas on development its not the case.

So i decided to write this tutorial for the beginners which will demonstrate lots of ASP.NET features.

First we need to create a folder in Server and share it with ASP.NET web server as described.

Right click on folder, select Web sharing tab and select the radio button “Share this folder”. One window appear, give it alias name which will be used in coding.

After this, open Run box and type “inetmgr“. you will see that your web shared folder appears in the IIS.

Right click on folders property. one window will opened.

Select “Directory Security” tab then click on “Edit” button and then check “Anonymous access”. And because of this setting any body can access or download that file.

Now we are ready, to create a sample application which will demonstrate that how to upload the file and use it.

In web.config add two keys. One for actual folder location in which we are going to upload the files and other its alias name. we can also hard code that, but its good practice to make it configurable at any time because in near future we may want to change the location.