C# App: Downloading a File

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • haba
    New Member
    • Nov 2007
    • 2

    C# App: Downloading a File

    Hi,

    I'm trying to download a file with c#, using the method WebClient.Downl oadFile. However, my url is of the type: http://somewebsite.com/download.htm?ID =14.
    DownloadFile works fine, and the file is downloaded. However, I have to provide a file name myself. I want the file on my computer to have the same name it has on the server.
    How can I do that?

    Thanks
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Normally this is achieved using the file.move() method. HTH.

    Comment

    • haba
      New Member
      • Nov 2007
      • 2

      #3
      Remotely?? How??

      The only way I could do it so far (a very poor way), is by checking the ContentType value of my HttpResponse... this is bad however, because, imagine I'm trying to download a zip file, the content type can vary according to the compression used...

      Any more ideas?

      Thanks again

      Comment

      Working...