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

Error when overring ContentType

1 Answer 55 Views
Compression
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 25 Jul 2009, 12:13 PM
Hi

I am generating a CSV file on the fly in my aspx page. RadCompression is giving me an error when processing is done and it is about to send a "application/octet-stream" content type to my page.

Here's my code.

                string strFileContent = sb.ToString(); // This is the CSV string generated 
 
                // EXPORT 
                string strFile = "export.csv"
                string ContentType = "application/octet-stream"
 
                Response.Clear(); 
                Response.ContentType = ContentType; 
                Response.AddHeader("Content-Disposition""attachment; filename=\"" + strFile + "\""); 
                Response.Flush(); 
                Response.Write(strFileContent); 
                Response.End(); 

I had to remove RadCompresstion from the web.config to get this working. Thanks.

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 27 Jul 2009, 03:56 PM
Hello Michael,

Can you please specify the exact error you are getting? Are you by any chance have enabled the compression for full page postbacks? If this is the case you may disable it and see if this makes any difference. 

All the best,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Compression
Asked by
Michael
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or