[thelist] .Net: Why are downloads 0 bytes?

Casey Crookston caseyc at IntelliSoftmn.com
Mon Jan 15 11:01:04 CST 2007

I am baffled. When implementing a file download script
(http://www.ondotnet.com/pub/a/dotnet/2002/04/01/asp.html) All the
downloaded files are 0 bytes.  


Here's the script:


'download file

Dim root As String = strPath & "Uploads\"

Dim filepath As String = Request.Params("file")

If Not filepath Is Nothing Then

Dim filename As String = Path.GetFileName(filepath)


Response.ContentType = "application/octet-stream"

Response.AddHeader("Content-Disposition", "attachment; filename=""" &
filename & """")



End If




Thanks, Casey

More information about the thelist mailing list