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

  • SEARCH
  • Home
  • 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 6958487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:08:46+00:00 2026-05-27T15:08:46+00:00

I have an action in aspnet mvc that returns a FileContentResult. I have noticed

  • 0

I have an action in aspnet mvc that returns a FileContentResult. I have noticed that when the fileDownloadName contains umlauts (ie åäöü) Internet Explorer can’t read the file name at all.

I have tried UrlEncoding:

return this.File(document.Content, contentType, Server.UrlEncode(document.Name));

but then all spaces are replaced by plus signs (+).

Is there a way to get unicode file names work with IE (keeping the original file name intact)?

This is what I’m currently using as a hack:

return this.File(
    document.Content, 
    contentType, 
    Server.UrlEncode(document.Name).Replace('+',' '));

(This renders space as an underscore in IE)

  • 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-27T15:08:46+00:00Added an answer on May 27, 2026 at 3:08 pm
    1. UrlEncode is misleadingly-named, it is only for form data. You would want UrlPathEncode instead which would solve the + problem. See this question for background.

    2. However in any case URL-encoding is the wrong thing to do here, as you aren’t constructing a URL. The fact that it works in IE is a bug, which is why you get %-sequences in other browsers.

    Unfortunately, there is no reliable cross-browser way to get non-ASCII characters into a Content-Disposition filename parameter. In theory it might have been possible using RFC 2331 rules, but even then the spec is arguable and the reality is nothing supports it. See this question for background.

    Is there a way to get unicode file names work with IE (keeping the original file name intact)?

    Drop the filename parameter from the Content-Disposition header and instead include the filename as a trailing path part of your script’s address, where it’s quite valid to use URL-encoding (UTF-8 and UrlPathEncode). eg for someaction controller:

    http://www.example.com/someaction/åäöü.txt
    http://www.example.com/someaction/%C3%A5%C3%A4%C3%B6%C3%BC.txt
    

    All browsers will offer to save the resulting file as åäöü.txt.

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

Sidebar

Related Questions

I have an asp.net mvc action that returns a file result. Behind the scenes,
Suppose I have an action that returns an rendered asp.net mvc control and send
using ASP.NET MVC 1.0 and I have a action that returns a JsonResult and
MVC 3 RTM. I have an action that returns a file (image/jpeg). I am
I am using ASP.NET MVC with jQuery. I have the following MVC Action that
I use jquery to post to an MVC controller action that returns a table
I have an action that returns a Dynamically Generated image however I need the
In an asp.net mvc application I have a method that returns a JsonResult to
Ok, so I have an action method that generates a PDF and returns it
I have an ASP.Net MVC Controller with a 'MapColumns' action along with a corresponding

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.