clp698 Posted March 5, 2006 Posted March 5, 2006 I have a site where I make available mp3 files that can be purchased and downloaded. The other day a lady called and said she had problems downloading a file as during the download Windows renamed the file like 106. So I tried to purchased and download the same file using XP and IE 6.0 and sure enough the name got chanted to a number and then Windows didn't know what do do with it. I then renamed the file giving it an .mp3 extension and it played fine in WMP. I then downloaded the same file using Firefox and it downloaded OK with the correct name and was playable. So, what is happening? Is it Anit-Virus, Internet Explorer, Firewall, or a combination of these things. I do all of my development on a Mac and thus have had no problems. It only seems to be a problems with XP and IE.
Guest Posted March 5, 2006 Posted March 5, 2006 you could adjust the catalog\download.php file where it constructs the header for the download page. That should take care of it.
clp698 Posted March 5, 2006 Author Posted March 5, 2006 you could adjust the catalog\download.php file where it constructs the header for the download page. That should take care of it. Forgive me for being so naive, but how it this done?
Guest Posted March 5, 2006 Posted March 5, 2006 you need to specify the content-type on the header. For example if I had mp3 files that someone would download then I would specify something like: header('Content-Type: audio/mpeg'); in the downloads.php If you have separate formats then you could extend the sql tables to accomodate for different file types.
clp698 Posted March 6, 2006 Author Posted March 6, 2006 you need to specify the content-type on the header. For example if I had mp3 files that someone would download then I would specify something like: header('Content-Type: audio/mpeg'); in the downloads.php If you have separate formats then you could extend the sql tables to accomodate for different file types. I made the changes as suggested and sure enough Internet Explorer downloaded the file as an MP3 file and was immediate playable. It, however, still renamed the file to a sequential number 109.mp3. Firefox does not rename the file.
Guest Posted March 6, 2006 Posted March 6, 2006 there are other headers to specify filenames you should also set the Content-Disposition header and supply a filename. If you need more info on the http headers here is a link: http://www.faqs.org/rfcs/rfc2616 My opinion for the particular hader case is that IE behaves while FF ignores.
clp698 Posted March 6, 2006 Author Posted March 6, 2006 there are other headers to specify filenames you should also set the Content-Disposition header and supply a filename. If you need more info on the http headers here is a link: http://www.faqs.org/rfcs/rfc2616 My opinion for the particular hader case is that IE behaves while FF ignores. You have been a great help. At least I have the downloads working. And you no doubt are correct that IE scrutinizes downloads more than FF.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.