Go to DotNetFunda.com
 Online : 2481 |  Welcome, Guest!   Login
 
Home > Interview Questions > ASP.NET Interview Questions > How will you upload a file to IIS in Asp ...

call for mock interview

ASP.NET Interview Questions

How will you upload a file to IIS in Asp and how will you do the same in ASP.net?

Author: Rohitshah | Posted on: 10/7/2008 4:39:52 AM | Category: ASP.NET | Views:1158 |  Print | Asked In: Many Interviews


Answer:
First of all, we need a HTML server control to allow the user to select the file. This is nothing but the same old <input tag, with the type set to File, such as <input type=file id=”myFile” runat=server />. This will give you the textbox and a browse button. Once you have this, the user can select any file from their computer (or even from a network). Then, in the Server side, we need the following line to save the file to the Web Server.

myFile.PostedFile.SaveAs ("DestinationPath")

Note: The Form should have the following ENC Type
<form enctype="multipart/form-data" runat="server">

Interesting?   Share and Bookmark this


Navigate to:

 Submit Interview Questions

Is String is Value Type or Reference Type in C#? ...

What is Attribute Programming? What are attributes? Where are they used? ...

Random Interview Questions
Help: If for some reason you are getting the same question by clicking Next Question or Previous Question, Try clicking Categories link above.

Related interview questions



Advertisement

About Us | The Team | Advertise | Contact Us | Feedback | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found copied contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)