Dim strRequest As String = Request.QueryString(0) '
If strRequest <> "" Then
Dim path As String = Request.QueryString(0)
Dim file As System.IO.FileInfo = New System.IO.FileInfo(path)
If file.Exists Then
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" & file.Name)
Response.AddHeader("Content-Length", file.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.WriteFile(file.FullName)
Response.End()
Else
Response.Write("This file does not exist.")
End If
Else
Response.Write("Please provide a file to download.")
End If
Thursday, February 11, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment