Daniel wrote:
streaming random filetypes from .aspx
how to stream a file from inside a .aspx? e.g. so one could go
href="./foo.aspx?file=bar.mp3" or href="./foo.aspx?foo.dat" etc.
preferabley i would like all file types to open with "save as" when
href clicked
Try this:
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-type", "application/octet-stream")
Response.AddHeader("Content-Disposition", "attachment;
filename=""bar.mp3""")
Response.Write(contentsOfBinaryFile)
Response.End()
End Sub