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 8715095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:45:56+00:00 2026-06-13T05:45:56+00:00

I am using asp.net mvc3, download file in the same browser (Chrome 22). Here

  • 0

I am using asp.net mvc3, download file in the same browser (Chrome 22). Here is the controller code:

[HttpPost]
public ActionResult Uploadfile(HttpPostedFileBase file)//HttpPostedFileBase file, string excelSumInfoId)
{
    ...
    return File(
        result.Output,
        "application/vnd.ms-excel",
        String.Format("{0}_{1:yyyy.MM.dd-HH.mm.ss}.xls", "Суммирование", DateTime.Now));
}

On my dev machine I download a programmatically created file with the correct name “Суммирование_2012.10.18-13.36.06.xls”.

Response:

Content-Disposition:attachment; filename*=UTF-8''%D0%A1%D1%83%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5_2012.10.18-13.36.06.xls
Content-Length:203776
Content-Type:application/vnd.ms-excel
Date:Thu, 18 Oct 2012 09:36:06 GMT
Server:ASP.NET Development Server/10.0.0.0
X-AspNet-Version:4.0.30319
X-AspNetMvc-Version:3.0

And from production server I download a file with the name of the controller’s action + correct extension “Uploadfile.xls”, which is wrong.

Response:

Content-Disposition:attachment; filename="=?utf-8?B?0KHRg9C80LzQuNGA0L7QstCw0L3QuNC1XzIwMTIuMTAuMTgtMTMuMzYu?=%0d%0a =?utf-8?B?NTUueGxz?="
Content-Length:203776
Content-Type:application/vnd.ms-excel
Date:Thu, 18 Oct 2012 09:36:55 GMT
Server:Microsoft-IIS/7.5
X-AspNet-Version:4.0.30319
X-AspNetMvc-Version:3.0
X-Powered-By:ASP.NET

Web.config files are the same on both machines.

Why does filename gets encoded differently for the same browser? Are there any kinds of default settings in web.config that are different on machines that I am missing?

  • 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-06-13T05:45:58+00:00Added an answer on June 13, 2026 at 5:45 am

    The dev server is running .NET 4, and the production server is running .NET 4.5. The MVC framework contains a heuristic for determining whether it needs to use RFC 6266 for the Content-Disposition header, and while this heuristic works correctly on .NET 4 it does not work correctly on .NET 4.5. The end result is that the Content-Disposition header gets mangled, as you’re witnessing in this instance.

    Your easiest course of action would probably be to upgrade the application to MVC 4. That version of the framework contains a different heuristic that is more robust and should work correctly on both .NET 4 and .NET 4.5.

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

Sidebar

Related Questions

I am using ASP.NET MVC3 with EF Code First. I have not worked previously
Possible Duplicate: ASP.NET MVC3 how to excute action method of controller using timer with
I am using Razor syntax in an ASP.NET MVC3 View inside a JavaScript code
I am using Asp.net mvc3 and displaying the .pdf file on my one of
Where I can download example source code of project with using Lucene.NET for ASP.NET
Using ASP.NET MVC3, the url http://localhost:22713/tests#123456 with the following code: Your user agent: @Request.UserAgent<br
Using ASP.NET MVC3. What I'm trying to do is initialize a Controller field/property with
I'm using ASP.NET MVC3. I've used Output Caching on controller method. [OutputCache(Duration = 3660,
i am using asp.net mvc3 and have two different type of request in same
I am using Asp.Net MVC3, for a project. In one of the page, I

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.