473,372 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

WebClient.DownloadFile Performance problem

I have been suddenly having a performance problem downloading images
from one server (productive) to another (productive) using the
following code ..

WebClient webClient = new WebClient();
try
{
webClient.DownloadFile(sourceUrlFilename, destinationFilename);
}
catch (Exception ex)
{
}

For each image that I try to download I have now a 3-6 second delay.
Before a few days this process ran without any delay. (Before the 18th
October 2005 it was fast and then since 18th October 2005 not)
On my development machine, which is behind a firewall / proxy server, I
get the following exception
System.Net.WebException
"The underlying connection was closed: Unable to connect to the remote
server."
Stack:
at System.Net.HttpWebRequest.CheckFinalStatus()\r\n at
System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)\r\n
at System.Net.HttpWebRequest.GetResponse()\r\n at
System.Net.WebClient.DownloadFile(String address, String fileName)\r\n
at Swisscom.IT.Immo.BOL.Image.CopyImageFile(String sourceUrlFilename,
String destinationFilename) in
z:\\webfolder\\app\\web\\bol\\image.cs:line 300

thanks for any help

Nov 19 '05 #1
1 2882
pe************@swisscom.com wrote:
I have been suddenly having a performance problem downloading images
from one server (productive) to another (productive) using the
following code ..

WebClient webClient = new WebClient();
try
{
webClient.DownloadFile(sourceUrlFilename, destinationFilename);
}
catch (Exception ex)
{
}

For each image that I try to download I have now a 3-6 second delay.
Before a few days this process ran without any delay. (Before the 18th
October 2005 it was fast and then since 18th October 2005 not)


Did the remote host change in any way? I don't think you can blame
WebClient for this one ;-)

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James Write | last post by:
Hi, I am using the webclient.downloadfile() method to download a file from a remote web server to the local harddrive. public CopyFile(string sSrcPath, string sDestPath) { WebClient oClient...
0
by: pascal_dumont | last post by:
Hi all, I have a problem with downloading files by using WebClient wc = new WebClient(); wc.DownloadFile("http://some_url.com/some_file.gif", "some_file.gif"); This returns the error 403...
6
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType =...
1
by: Cheri Elkin | last post by:
I recieve the following error when attempting to download a file from our web server to be placed on our hard drive. Any clues as to why I would get this error? By the way, the directory already...
8
by: DEWright_CA | last post by:
Why does WebClient.DownloadFile loose my completed path? Ok, I have a function in my app then when my button is clicked it checks to see if the files come from a local drive or a http address....
2
by: Lila Godel | last post by:
I am having a problem with the download of web pages via the WebClient.DownloadFile function in the specialized VB.Net 2003 I.E. plug-in I am designing to speed up the work on my latest project. ...
1
by: David Satz | last post by:
Hello--I just upgraded to Visual Studio .NET 2005 and suddenly, all my .NET 1.1 applications that accessed Web sites have broken. For example, this code: WebClient wc = new WebClient();...
1
by: vin.dor | last post by:
Dear All, I am using WebClient in my Visual Studio .Net 2003 project to download an image from the Internet. The following is my function: C# Code: public static bool downloadFile(string...
8
by: =?Utf-8?B?UnVpIE9saXZlaXJh?= | last post by:
WebClient.DownloadFile I am using the WebClient.DownloadFile function to download a file from server to a local client. When I execute the below code, file is created in server and not in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.