all groups > asp.net > february 2007 >
You're in the

asp.net

group:

file download via Response.BinaryWrite shows HTML tags


file download via Response.BinaryWrite shows HTML tags MichiMichi
2/28/2007 7:52:07 PM
asp.net:
I am trying to secure filedownload via streaming to protect files on
the server. This works very well but when I open the file in a notepad
editor it shows always HTML code at the end of the file.

Since the code runs in a aspx file, the added HTML Code always
streamed at the end.

What do I have to do so the files are stored without the HTML tags on
the client machine?



Here is the code:


..............
Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Response.AppendHeader("content-disposition", "attachment;
filename=" & strFilename)

Response.ContentType = strContentType
Response.BufferOutput = True

Response.BinaryWrite(bytFile)
..........
Re: file download via Response.BinaryWrite shows HTML tags MichiMichi
2/28/2007 8:18:53 PM
[quoted text, click to view]
Got if...forgot to write "Response.end" right after
Response.BinaryWrite(bytFile)



[quoted text, click to view]

AddThis Social Bookmark Button