file download via Response.BinaryWrite shows HTML tags

M

MichiMichi

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)
..........
 
M

MichiMichi

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?
Got if...forgot to write "Response.end" right after
Response.BinaryWrite(bytFile)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top