Forum Moderators: travelin cat

Message Too Old, No Replies

Downloading Files

         

MarkDenton

10:32 am on Nov 13, 2003 (gmt 0)

10+ Year Member



Hi guys. I am looking for some code (asp preferably) to download a file that will work on a mac. I have tried a couple of ways but the internet page opens the file, rather than selecting to save it.

Does anyone have any source code they can point me to?

Thanks guys

Mark

MarkDenton

10:34 am on Nov 13, 2003 (gmt 0)

10+ Year Member



I also meant to say, I only need a simple peice of code, I have a page at the mo, that passes a filename to another page, which then downloads the file, well it does on a PC anyway. Nothing too flash or anything.

Thanks guys

Mark

BjarneDM

4:12 pm on Nov 13, 2003 (gmt 0)

10+ Year Member



Problems of that kind is typically caused by having bad mime-types in the server-setup. Now, to test this, get hold of Mozilla and [livehttpheaders.mozdev.org...] Go to the download page, open livehttpheaders and click on the download link. Then observe in the livehttpheaders window what kind of Content-Type your server says that the file has to be treated as.

The default mime-type/Content-Type is usually text/plain, which is why you see a lot of garbled and incomprehensible text if the correct mime-type hasn't been set on the server.

As you are asking about *.asp files, I'm guessing you are also using a M$ windows server of some kind. Try asking in one of the more M$ related forums on where to find the settings for mime-types on M$ windows servers.

Also, if you are serving content that the browser is capable of handling internally there's no way to force a download to disk. *.dmg, *.zip, *.sit and other compressed files are usually either set up to be downloaded or handled by an external program.

The correct mime-types for some mac-specific files are:
application/x-stuffit sit
application/mac-binhex40 hqx
*.dmg doesn't seem to have a mime-type registered

If all else fails use application/octet-stream

From the Apache mime-types file:
For more information about Internet media types, please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type registry is at <http://www.iana.org/assignments/media-types/>