Click here to Skip to main content
13,145,068 members (54,710 online)
Click here to Skip to main content
Add your own
alternative version


5 bookmarked
Posted 18 Mar 2014

Download File (Firefox Issue)

, 18 Mar 2014
Rate this:
Please Sign up or sign in to vote.
Issue in downloading file from


When we download files from some Page using the Response Header. If the file name contains any space then In Firefox it gets only the first word from file name and make it available to download, so after downloading the file due to lack of File Extension, a user faces problem in opening of the file. Also file would be in improper name.

Cause of Problem

Normally we use following line of code in our application...

Response.AddHeader("Content-Disposition", "attachment; filename=" + filename); 

This will skipped the following words from the file name

ex. If file name is : ABC MNO XYZ.xls then browser will download file with name ABC without extension.


We can use following line of code which works properly in any browser...

Response.AddHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"");  

This will download file with full name.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Nipesh Shah
Software Developer
India India
No Biography provided

You may also be interested in...


Comments and Discussions

QuestionThanks Pin
Abdul Khaliq6-Jul-17 0:48
memberAbdul Khaliq6-Jul-17 0:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170915.1 | Last Updated 18 Mar 2014
Article Copyright 2014 by Nipesh Shah
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid