Click here to Skip to main content
12,559,389 members (49,430 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


5 bookmarked

Download File (Firefox Issue)

, 18 Mar 2014 CPOL
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

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.161026.1 | Last Updated 18 Mar 2014
Article Copyright 2014 by Nipesh Shah
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid