WebClint download file not working on server


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: WebClint download file not working on server

  1. #1
    Join Date
    Jun 2008
    Posts
    5

    WebClint download file not working on server

    Hi,
    To download file, the following code works on localhost but not working on Web server. Can you help please?

    Thanks

    austin2.

    WebClient wc = new WebClient();
    wc.DownloadFile(@"http://www.WebUrl.com/Documents/Test.pdf", @"C:/test/Test.pdf");

  2. #2
    Join Date
    Oct 2008
    Posts
    142

    ftp client

    hi there,

    can you copy and paste the generated error?
    it turns out that on your client computer, ftp client settings work fine.
    however, in a server there are security settings for ftp access, which are stricter than the ones you have in your client computer.
    that means your code might need to be modified to comply with the security settings of your server.
    however, there is something you can do:
    in your server, open internet explorer (indeed you can try all browsers in your server) and use this web address --> http://www.WebUrl.com/Documents/Test.pdf
    watch the results, which can give you an idea of what is be happening.
    moreover, you can use ftp client software, like filezilla, cute ftp, core ftp, and so forth, and then watch what happens between the same program between your computer and this server.
    besides, http://www.WebUrl.com/Documents/Test.pdf is downloading via http://
    probably, you can try by downloading through ftp:// if there is such ftp server that you can use to download this file.
    you could also get the stack trace of this error, by using StackTrace property of your exception instance in your catch block.

    i hope this helps,

    tonci korsano.

  3. #3
    Join Date
    Jun 2008
    Posts
    5

    WebClint download file not working on server

    Thanks, Tonci

    Our Web site is an IIS. The page can download file from my localhost machine. But the same page not working on Web server. There is no error message.

    the Test.pdf file can display as well on the browser. Is there any browser security setting or network security setting I can try?

    Thanks

    austin2

  4. #4
    Join Date
    Oct 2008
    Posts
    142

    maybe looking at the event log

    hi there,

    if you opened a browser in your server and could download locally that file then maybe you can look for events in your event log.
    i mean events about iis.
    this page --> http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx talks about event ids related to iis, and the last one mentions about downloads being prevented.
    you would basically look for these events in the typical sections of security, application and system.
    besides looking for iis events, i would also look at dotnet generated events.
    this event might be a warning instead of an error.
    it shouldn't be so hard to find such an event because you know the timestamp at which you tried to download this file with your program that works from your computer.

    good luck,

    tonci korsano.

Similar Threads

  1. File Download
    By mikester20 in forum ASP.NET
    Replies: 0
    Last Post: 10-30-2006, 05:25 PM
  2. Replies: 0
    Last Post: 02-12-2006, 06:27 PM
  3. Replies: 2
    Last Post: 11-03-2005, 07:40 AM
  4. .xls file as linked server
    By bubberz in forum ASP.NET
    Replies: 1
    Last Post: 10-02-2005, 11:59 PM
  5. Replies: 7
    Last Post: 09-15-2000, 08:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center