Hi:
I'm writing an application to downloads files from a remote server by ftp using WebClient Class
My code is something like this
---------------------------------------------------------
Try
Dim remoteFile As String = "ftp://187.153.7.42/songs/TRACK_NO01.MP3"
Dim client As New WebClient
client.Credentials = New NetworkCredential("user1", "password")
client.DownloadFile(remoteFile, "Z:\TRACK_NO01.MP3")
MsgBox("file downloaded!")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
------------------------------------------------------
When I download small files (600 KB) it works but when I download bigger files(3 MB) I get this Exception after few minutes
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive.
I suposse this is because timeout
Is there a property or method to increase timeout in WebClient Class?
or
do I need to set something on windows?
My windows is server 2003 enterprise edition
Thanks!
I'm writing an application to downloads files from a remote server by ftp using WebClient Class
My code is something like this
---------------------------------------------------------
Try
Dim remoteFile As String = "ftp://187.153.7.42/songs/TRACK_NO01.MP3"
Dim client As New WebClient
client.Credentials = New NetworkCredential("user1", "password")
client.DownloadFile(remoteFile, "Z:\TRACK_NO01.MP3")
MsgBox("file downloaded!")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
------------------------------------------------------
When I download small files (600 KB) it works but when I download bigger files(3 MB) I get this Exception after few minutes
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive.
I suposse this is because timeout
Is there a property or method to increase timeout in WebClient Class?
or
do I need to set something on windows?
My windows is server 2003 enterprise edition
Thanks!