donniedarko801
asked on
Http file download & Keeping original file name. How?
Hello experts,
I have this small piece of code and it works great except I have to hard code the local file name. Is there a way to save downloaded file with original file name?
Dim sSourceUrl As String ' File to download with URL
Dim sLocalFile As String ' File to crate on the local system
Dim client As New WebClient
sSourceUrl = "http://www.download.com/file.txt"
sLocalFile = "c:\Temp\file.txt"
client.DownloadFile(sSourc eUrl, sLocalFile)
Thanks for anything.
I have this small piece of code and it works great except I have to hard code the local file name. Is there a way to save downloaded file with original file name?
Dim sSourceUrl As String ' File to download with URL
Dim sLocalFile As String ' File to crate on the local system
Dim client As New WebClient
sSourceUrl = "http://www.download.com/file.txt"
sLocalFile = "c:\Temp\file.txt"
client.DownloadFile(sSourc
Thanks for anything.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Just out of curiosity, how would you download an http folder and all files within from a website?
I'll be happy to start another question if need be.