Go to DotNetFunda.com
 Welcome, Guest!  
LoginLogin  
Take a break and be productive! read technical jokes.
 Skip Navigation Links Home > Interview Questions > How will you upload a file to IIS in Asp and how will you do the same in ASP.net? ...

ASP.NET Interview Question


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:784 |  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?   Bookmark and Share


Navigate to:

 Submit Interview Questions

<< Previous Question: What is Attribute Programming? What are attributes? Where are they used?

Next Question >>: Is String is Value Type or Reference Type in C#?

Random Questions: Random Interview Questions

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

Advertisement

About Us | Contact Us | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
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)