tags:

views:

65

answers:

2

Hello,

VS 2008 SP1

I am using the web client to download a file. Which works ok.

However, now I have to download many and the number of files to download will change everyday.

I am not sure how I can get the web client to know which files have been downloaded or not? I was thinking of using a for loop to download each file. But I will never know how many there are to download?

The web client could download the same file twice?

Many thanks for any suggestions,

Private Sub btnStartDownload_Click(ByVal sender As Object, ByVal e As EventArgs)
 Dim client As New WebClient()
 AddHandler client.DownloadProgressChanged, AddressOf client_DownloadProgressChanged
 AddHandler client.DownloadFileCompleted, AddressOf client_DownloadFileCompleted

 ' Starts the download
 client.DownloadFileAsync(New Uri("UrlFilePath"), "DownloadPath")

 btnStartDownload.Text = "Download In Process"
 btnStartDownload.Enabled = False
End Sub
+1  A: 

We have previously built a system that required the the user download many files. The way we solved it was to zip the files on the server side then download it as a single file.

Shiraz Bhaiji
I can't really do that. The users want all the individual files downloaded and don't want to have to unzip them.
robUK
Are these internal users? Will they always be on an internal network? Do they have Office enterprise licences?
Shiraz Bhaiji
These are user that will install our software and download the updates through the Internet.
robUK
+1  A: 

You could try using a multi-part content type and BinaryWrite but my understanding is that browser support for that content type is spotty at best.

http://stackoverflow.com/questions/1041542/how-to-download-multiple-files-with-one-http-request

CptSkippy