Dear Microsoft, I am fed up with having to take your non-compliant
shit! I hearby announce Internet Explorer shall not be supported by me...
EVER.
My advice to readers is ditch the massive resource guzzling, insecure, standards non-compliant
pile of crap and use something safer, faster and better!
See my list.
Downloader Script
The Problem. You want your nice PDF, PNG or PHP file to be forced to download in the browser.
This is not common practace, take the image for example; the browser doesn't want to force download an image, it wants
to open it! Here is the a solution! Using this script you can force download an image, a script, an Acrobat
document... you name it!
This script currently supports a wide variety of files, perhaps quite biased towards architectural filetypes however
once downloaded you can change it to suit your needs as you wish.
Here are a few of the filetypes already written in for you!
- 3dm (application/octet-stream)
- 3ds (application/x-3ds)
- 7z (application/x-7z-compressed)
- ace (application/x-ace-compressed)
- ai (application/postscript)
- asp (text/plain)
- atom (application/xml)
- avi (video/avi)
- bz2 (application/x-bzip)
- bzip (application/x-bzip)
- css (text/css)
- dmg (application/x-apple-diskimage)
- doc (application/msword)
- docx (application/msword)
- dwg (application/acad)
- dxf (application/acad)
- exe (application/octet-stream)
- f4a (video/x-flv)
- f4b (video/x-flv)
- f4p (video/x-flv)
- f4v (video/x-flv)
- fla (application/x-shockwave-flash)
- flac (audio/x-flac)
- flv (video/x-flv)
- ghx (application/xml)
- gif (image/gif)
- gz (application/x-gzip)
- htm (text/html)
- html (text/html)
- ical (text/calendar)
- ics (text/calendar)
- iso (application/x-iso9660-image)
- jpeg (image/jpeg)
- jpg (image/jpeg)
- js (text/javascript)
- m4a (audio/mp4)
- ma (application/maya)
- mb (application/maya)
- mkv (video/x-matroska)
- mp3 (audio/mpeg)
- mp4 (video/mp4)
- msi (application/x-ole-storage)
- obj (application/octet-stream)
- odg (application/vnd.oasis.opendocument.graphics)
- odp (application/vnd.oasis.opendocument.presentation)
- ods (application/vnd.oasis.opendocument.spreadsheet)
- odt (application/vnd.oasis.opendocument.text)
- oga (audio/ogg)
- ogg (audio/vorbis)
- ogv (video/ogg)
- opml (application/xml)
- otf (application/x-font-otf)
- pdd (image/photodeluxe)
- pdf (application/pdf)
- php (application/x-httpd-php)
- pl (text/x-perl)
- png (image/png)
- pps (application/vnd.ms-powerpoint)
- ppsx (application/vnd.ms-powerpoint)
- ppt (application/vnd.ms-powerpoint)
- pptx (application/vnd.ms-powerpoint)
- ps (application/postscript)
- psb (application/x-photoshop)
- psd (application/x-photoshop)
- psp (application/octet-stream)
- py (text/x-python)
- rar (application/x-rar-compressed)
- rb (application/x-ruby)
- rss (application/xml)
- rtf (text/rtf)
- skp (application/vnd.sketchup.skp)
- stl (application/octet-stream)
- svg (image/svg+xml)
- swf (application/x-shockwave-flash)
- tar (application/x-tar)
- tar.gz (application/x-gzip)
- tif (image/tiff)
- tiff (images/tiff)
- torrent (application/x-bittorrent)
- ttf (application/x-font-ttf)
- txt (text/plain)
- vcard (text/x-vcard)
- vcf (text/x-vcard)
- wav (audio/wave)
- wma (audio/x-ms-wma)
- wmv (video/x-ms-wmv)
- xcf (image/x-xcf)
- xht (text/html)
- xhtml (text/html)
- xls (application/vnd.ms-excel)
- xlsx (application/vnd.ms-excel)
- xml (application/xml)
- xpi (application/x-xpinstall)
- zip (application/zip)
Download
Like what you see? Good, download it here...
Usage
So simple
<a href="downloader.php?f=file.ext">Download</a>
and you are done!
Recommended Link
I highly recommend that you look at this when creating a download link, it will help communicate exactly the file type
you are offering to download. It works out of the box with the link format used too!
Iconize with CSS