J
jeffpriz
I'm have a situation where I need to put a download link/button on a
page, where the file to be downloaded does not exist on our webservers
.... So I'm using Response.WriteFile (i've also tried
Response.TransmitFile) to put the file into the response..
My trouble is with a Zip file.. The user gets propmpted to Open or Save
etc.. If they clicks save, the file saves just fine.. no problem... If
they click Open, their Zip program will open, with the file, except,
the contents of the zip are not there.. It opens as an empty zip!
my code looks something like this:
Dim thisFile As System.IO.FileInfo
thisFile = New FileInfo(file Location)
Response.Clear()
Response.AddHeader("Content-Length",
thisFile.Length.ToString)
Response.ContentType = "application/x-zip-compressed"
Response.AddHeader("Content-disposition", "filename=" &
thisFile.Name)
Response.TransmitFile(thisFile.FullName)
'Response.WriteFile(thisFile.FullName)
Response.End()
I've tried a ContentType of "application/x-zip-compressed", also, I've
just tried ContentType "application/none".. with no luck.
Am I missing a Header somewhere to tell the client how to open the
file?
thanks
jeffpriz
page, where the file to be downloaded does not exist on our webservers
.... So I'm using Response.WriteFile (i've also tried
Response.TransmitFile) to put the file into the response..
My trouble is with a Zip file.. The user gets propmpted to Open or Save
etc.. If they clicks save, the file saves just fine.. no problem... If
they click Open, their Zip program will open, with the file, except,
the contents of the zip are not there.. It opens as an empty zip!
my code looks something like this:
Dim thisFile As System.IO.FileInfo
thisFile = New FileInfo(file Location)
Response.Clear()
Response.AddHeader("Content-Length",
thisFile.Length.ToString)
Response.ContentType = "application/x-zip-compressed"
Response.AddHeader("Content-disposition", "filename=" &
thisFile.Name)
Response.TransmitFile(thisFile.FullName)
'Response.WriteFile(thisFile.FullName)
Response.End()
I've tried a ContentType of "application/x-zip-compressed", also, I've
just tried ContentType "application/none".. with no luck.
Am I missing a Header somewhere to tell the client how to open the
file?
thanks
jeffpriz