- World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions - Testing EBooks, Tutorials, Articles, Jobs, Training Institutes etc. - Gate EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc. - MBA EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc. - IAS EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc. - SAP EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc. - of GRE EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.

Sponsored Links

Interview Questions
Our Services

Question :

Can we use http handlers to upload a file in

Category ASP.NET Interview Questions
Rating (4.5) By 19 users
Added on 7/27/2011
Views 1079
Rate it!



Answer is yes. We can use http handlers to upload a file in

To perform file upload in ASP.NET, you need to know two classes: the System.Web.UI.HtmlControls.HtmlInputFile class and the System.Web.HttpPostedFile. The first class represents an HTML control that the user uses to select a file on the client side and upload it. The latter represents the uploaded file itself, and an instance of this class is obtained from the HtmlInputFile control. The next two subsections discuss each class in detail.

<% @ Import Namespace="System.IO" %>
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)

Dim root As String = "C: emp"
Dim filepath As String = Request.Params("file")
If Not filepath Is Nothing Then
If File.Exists(filepath) And filepath.StartsWith(root) Then
Dim filename As String = Path.GetFileName(filepath)
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", _
"attachment; filename=""" & filename & """")
End If
End If

End Sub


If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in
  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification Enter the above shown code: *
Inform me about updated answers to this question

Related Questions
View Answer
What is the exact purpose of http handlers and interfaces?

View Answer
What is the difference between excute query and excute nonquery.?

View Answer
Difference beetween datagrid and datareader?

View Answer
What is the difference between excute query and excute nonquery.?

View Answer
Explain Assemblies?,Difference between Panel and GroupBox?,Differences between ASP and ASP.NET?

View Answer
What is the trace in ASP.NET

View Answer
How do we connect to the 11S if we want to use it instead of the built in Web Server?

View Answer
I am searching a record in datagrid.if i enter any value it display record not found,if the record is not there.
but i enter Apostrophe it is showing error(Cannot perform 'Mod' operation on System.String and System.String) to clear this bug.....

View Answer
While searching a record in database it accepts all the letters and special characters.but,i enter Apostrophe it is showing error(Cannot perform 'Mod' operation on System.String and System.String) like this...
how to clear this bug?

View Answer
can i assign datagrid.datasource = datareader
will it work?
will it fill my datagrid with the values

View Answer
What do you mean by authentication and authorization?

View Answer
Whats the use of @ Register directives ?

View Answer
What are different properties provided by Object-oriented systems ? Can you explain different properties of Object Oriented Systems? Whats difference between Association , Aggregation and Inheritance relationships?

View Answer
What is the maximum number of cookies that can be allowed to a web site?

View Answer
What is .net frame work?

View Answer
What is Reflection

View Answer
Whats the significance of Request.MapPath( )

View Answer
What are web parts ?

View Answer
How to handle the exception occured in catch block? (If a exception occurs in catch block,which statement is executed next?)

View Answer
How to compare an xml schema with xml schema?

View Answer

Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here - Best Freshers & Experienced Jobs Website.

View ALL ASP.NET Interview Questions & Answers

User Options
India News Network

Latest 20 Questions
Is the anti-spam software user-based?
What is Email spam ?
What is an antispam?
What is the Captcha value?
What is MagicSpam?
What is an execution plan? When would you use it?
What is BCP? When does it used?
What are the advantages of using Stored Procedures?
What is a Scheduled Jobs or What is a Scheduled Tasks?
What is NOT NULL Constraint?
What is CHECK Constraint?
What is UNIQUE KEY constraint?
What is the difference between a Local and a Global temporary table?
Name 3 ways to get an accurate count of the number of records in a table?
What is Log Shipping?
What is SQL Server Agent?
Which command using Query Analyzer will give you the version of SQL server and operating system?
What are the authentication modes in SQL Server? How can it be changed?

Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |

Copyright ©2003-2016, All Rights Reserved.
Privacy Policy | Terms and Conditions

Cache = 0.927002 Seconds