Dim
strRequest
As
String
= Request.QueryString(
"file"
)
'-- if something was passed to the file querystring
If
strRequest <>
""
Then
'get absolute path of the file
path
= Server.MapPath(strRequest)
'get file object as FileInfo
file
System.IO.FileInfo =
New
System.IO.FileInfo(path)
'-- if the file exists on the server
file.Exists
'set appropriate headers
Response.Clear()
Response.AddHeader(
"Content-Disposition"
,
"attachment; filename="
& file.Name)
"Content-Length"
, file.Length.ToString())
Response.ContentType =
"application/octet-stream"
Response.WriteFile(file.FullName)
Response.
End
'if file does not exist
Else
Response.Write(
"This file does not exist."
'nothing in the URL as HTTP GET
"Please provide a file to download."
Ifit is downloding in default folder but i want to give option to client so that he can select the folder where he want to save the downloaded files