DIFFERENCE IN ASP.NET FILE UPLOADING FUNCTIONS

Manoj Bhatt

Total Post:154

Points:1086
Posted by  Manoj Bhatt
C# 
C#
 825  View(s)
Ratings:
Rate this:

I am learning how to upload a file to a server in C# ASP.NET.

What is the difference between these 2 functions:

element.PostedFile.SaveAs();

WebClient's wc.UploadFile();

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: Difference in ASP.NET file uploading functions

    Hi Manoj, 


    They are extremely different.

    HttpPostedFile represents a file that has been sent to your server from a client.

    WebClient.UploadFile() allows you to send a file to an arbitrary server from your client.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!