Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4587750
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:49:29+00:00 2026-05-21T21:49:29+00:00

I am using WebClient.UploadFile to upload a file to this kind of URL –

  • 0

I am using WebClient.UploadFile to upload a file to this kind of URL – http://example.com/file.aspx via HTTP POST method.

How can I get that file and save it to a sepecific location on the server? What code should I write inside file.aspx to do this?

When I search, all examples assume I use the file upload control. But how can I get and save a file sent via HTTP POST generally in ASP.Net?

I am using C#, so C# code example will be great. But I have no probs converting VB to C#.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T21:49:30+00:00Added an answer on May 21, 2026 at 9:49 pm

    In the server-side page (which, BTW, ought to be an ASHX rather than an ASPX), use the Request.Files collection.

    For example, you can write Request.Files[0].SaveAs(Server.MapPath("~/Something"))

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to upload file to a host by using WebClient class. I also
I am trying to upload file to an sharepoint online server using webclient. Up
I am using the WebClient class in .NET 2.0 to perform an HTTP POST
I am trying to upload files to a web server using System.Net.WebClient.UploadFile but I
HttpPostRequest with Files only in VB2008 is easy: Using wc As New System.Net.WebClient() wc.UploadFile(http://server.de/exemple.php,
I'm uploading a file using the UploadFile method on the WebClient object. When the
I want to use https to upload a file using WebClient's UploadData method. And
I am trying to get contents of http://www.yahoo.com using WebClient#DownloadStringAsync() . However as Silverlight
I'm using webClient.DownloadFile() to download a file can I set a timeout for this
I'm trying to post to a webpage using WebClient in C#. Somehow the parameters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.