|
-
Jul 30th, 2009, 12:48 PM
#1
Thread Starter
Frenzied Member
Downloading more than one file from web server
Hello,
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,
Code:
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
-
Jul 30th, 2009, 01:14 PM
#2
Re: Downloading more than one file from web server
Unless you somehow get a list of the files available for download from the webserver and you maintain a list of downloaded files yourself which you can then compare the 2 lists to figure out which file has not been downloaded, I don't think you can tell the webclient to download only files that has not been downloaded.
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Jul 30th, 2009, 01:23 PM
#3
Thread Starter
Frenzied Member
Re: Downloading more than one file from web server
Hello,
Thanks for your response.
I can maintain a list of files myself that I can download and compare. But I think I would have to download it first then compare. And it could keep trying to download the same file. I think I might end up going round in circles.
Is there a way to get the number of files that are on the web server?
Many thanks,
-
Jul 30th, 2009, 01:27 PM
#4
Re: Downloading more than one file from web server
 Originally Posted by steve_rm
Is there a way to get the number of files that are on the web server?
Short answer: No.
Unless: you own that website and you have to modify the website to provide you with smoe mechanism to get the list of files available (a webservice or simply another webpage that list out the files)
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Jul 30th, 2009, 03:25 PM
#5
Hyperactive Member
Re: Downloading more than one file from web server
I like to use flashfxp.. It's easy. Visual Studio is good for writing code. Leave it that way.
-
Jul 30th, 2009, 09:20 PM
#6
Thread Starter
Frenzied Member
Re: Downloading more than one file from web server
The flashfxp is not a solution for this issue.
Thanks anyway
-
Jul 30th, 2009, 09:23 PM
#7
Re: Downloading more than one file from web server
You have to retrieve something from the server to compare to something local. Depending on circumstances that could be the file timestamp, a hash of the contents or the actual contents.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|