This is a migrated thread and some comments may be shown as answers.

Problem using response.transmitfile within RADWindow

1 Answer 125 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 13 Jan 2011, 10:35 PM
I have a RADWindow that will download a file to the user when they click a button on the window.  The file (text/csv) is being downloaded successfully however appended to the file is all of the RADWindow html.

The following is the code used to download the file.

Response.ContentType = "text/csv"
Response.AppendHeader("Content-Disposition", "attachment; filename=" & wrkFileName)
Response.TransmitFile(Server.MapPath(fileName))

Thanks for any help.

1 Answer, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 14 Jan 2011, 03:38 PM
The solution is to add a header and stipulate the content length (which would be the length of the file contents).  Similar to the following.

Response.AppendHeader("Content-Length", fileInf.Length)
Tags
Window
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or