I am using a Download Class which i found here http://www.phpclasses.org/package/3220-PHP-Serve-files-for-download-with-resume-support.html to let ppl download mp3 files.
It works great in all browsers except Firefox (in all versions).
When i download an mp3 file using this class in firefox, it downloads files without .mp3 extension. what may cause this and how can i fix it ?
It seems that for Firefox to save the file with an extension you must surround the filename with quotes.
header('Content-Disposition: attachment; filename="'.$file.'"');
Please check again filename. If file download have 1 character is spacebar (" ") Example: "template import.xls". Firefox will be error that without extension in download. You can function replace(" ", "") to fix this issue with asp.net:
HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=" + reportName.Replace(" ", ""));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With