Question Download Multiple Files

AJferlok

New member
Joined
Jun 27, 2009
Messages
3
Programming Experience
1-3
Hi

I am writing a fairly basic patcher application for my friend whom is currently hosting a game server.

Now to download a file i have used My.Computer.Network.DownloadFile
This works for the first file but then crashes when it goes to download a second file leavign me with the world most inexplicable exception message: "Illegal characters in path."

Here is the line it occurs on:
My.Computer.Network.DownloadFile(server & patch_files(patched_files), "C:\Users\AJ\Desktop\Temp\" & patch_files(patched_files))

server = "http://AJferlok.fileave.com/"
patched files is an integer (The files are read from a file and inputed into an array)
patch_files() us the array of files that need to be downloaded

Is their any particular reason for this?
 
Last edited:
The fact that you answered the question that way suggests to me that you haven't actually tested EXACTLY what the path is. You're assuming that the correct path is being built from various parts. Don't assume. Test. Don't pass expressions to DownloadFile. Build the two paths first and assign them to variables and actually look at the contents of those variable before passing them to DownloadFile. You'd be surprised how many times people think they are using some value without actually looking to make sure that they are and it turns out that the value they are actually using is something else that is obviously wrong. No matter how obvious you think something is, when it's not working do NOT assume. ALWAYS test.
 
Look i have tested it and the EXACT path is this: "C:\Users\AJ\Desktop\Temp\FairyFountain.pdf" so as far as i can see their is no illegal charactes.

I do however think that because im downloading a series of files through a loop that perhaps the loop is running to fast, therfore not allowing the previous download to finish properly which would explain why the file size of the download is not correct and thus may explain why its throwing this exception.
 
Back
Top