Go to DotNetFunda.com
 Welcome, Guest!  
LoginLogin  
{ Submit content and get exposure !!! }
Submit: Article | Interview Question | Tips | Joke | Question | Link || Search  
 Skip Navigation Links Home > Interview/Exam Questions > How will you upload a file to IIS in Asp and how will you do the same in ASP.net? ...


.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:528 |  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:

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

Next Interview 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 and Previous, Try clicking Random Question or Category link above.


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)