Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 525949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:43:31+00:00 2026-05-13T08:43:31+00:00

Firefox is for some reason not properly handling content sent through my .NET HTTP

  • 0

Firefox is for some reason not properly handling content sent through my .NET HTTP handler; it appears to be not honoring the content type header. Rather, it sees the content as being HTML. The URL mapped to the request even has a .csv extension. Internet Explorer and Chrome are doing the right thing. The problem is happening for both a “text/css” and an “application/pdf” handler.

Here’s a fragment of my HTTP handler’s ProcessRequest method:

public void ProcessRequest(HttpContext context)
{
    // ...

    // Set the output headers
    context.Response.ClearHeaders();
    context.Response.ContentType = "text/csv";
    context.Response.AddHeader(
        "Content-Disposition", "attachment; filename=foo.csv");

    // Code that writes to the output stream
    // ...

    context.Response.End();
}

What’s missing from my response that would enable Firefox to recognize the content type as expected?

Edit 1:

When using the Firefox Live HTTP Headers extension, I saw, I’m getting back the following headers. It looks like my ContentType header is getting lost.

HTTP/1.x 200 OK
Server: ASP.NET Development Server/9.0.0.0
Date: Thu, 31 Dec 2009 02:34:09 GMT
X-AspNet-Version: 2.0.50727
Content-Disposition: attachment;filename="foo.csv"
Cache-Control: private
Content-Type: text/html
Content-Length: 66682
Connection: Close

Edit 2:

Found the issue. In my handler, I was using context.Server.Execute to generate HTML from an ASPX template, then processing that HTML. In other words, I was not using context. Server.Execute to directly output to the response. Despite this, running that method modify’s the current context’s response headers. So this was undoing the headers I had set. Moving the code that modifies the headers to after context.Server.Execute solved the problem.

The reason this only affected Firefox is because the other browsers use the file extension rather than the content type. Firefox does the right thing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:43:31+00:00Added an answer on May 13, 2026 at 8:43 am

    That does seem odd. I would install the Live HTTP Headers add-on for Firefox just to confirm that Firefox is indeed seeing those two headers as you’d expect.

    RFC 2616 also seems to suggest placing quotes round the filename, so you could try that out as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 265k
  • Answers 265k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer # php -r 'var_dump(memory_get_usage());' int(75880) # php -r 'var_dump(memory_get_usage());' int(75880)… May 13, 2026 at 12:26 pm
  • Editorial Team
    Editorial Team added an answer TouchXML will parse it automatically. If you retrieve the stringValue… May 13, 2026 at 12:26 pm
  • Editorial Team
    Editorial Team added an answer There are two different ways you can automatically export to… May 13, 2026 at 12:26 pm

Related Questions

I have to admit I never had to worry about Firefox versions before when
I have a URL with unicode characters in it http://www.argaam.com/Common/Handlers/DownloadAttachment.aspx?referer=/portal&fileName=اعمار . -الربع الثاني_633857794599657020.pdf&folder=\CompanyFinancialResults\ this
Presently i have the following action to return files (images, PDF's, etc) from my
I have a <div> on a webpage which ends up with a calculated height
It works in IE6, and FireFox; but for some reason not in IE7. Using

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.