System.Net.WebClient's Upload method fails - 404 Not found

Discussion in 'Visual Studio' started by perpetualpr, Jan 14, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,
    I am using vb2003 and theSystem.Net.WebClient class to upload and download a file. The download works fine but the upload fails and gives me an error number 404 - Not found. I have researched the web but couldn't find a solution. The code is staright forward (below). I am wondering if www.discountasp.net prevents uploads from taking place. Any insight into this problem is greatly appreciated.




    Dim client As New System.Net.WebClient


    client.UploadFile("http://www.imagereflector.com/Data_on_the_Web.mdb", "C:\Data_on_the_Web.mdb")

    Thanks
    -Doug



    Douglas Schofield
     
  2. As far as I know dasp does not restrict the upload method on the servers. For most part .net classes are fully supported. Instead of using the WebClient class have you tried using the htmlinputfile class instead. I did a quick web app on this class just as a test a while back and it worked really great.
     
  3. I don't think you can upload files using the System.Net.WebClient to an http address. Try using the FileUpload control instead.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page