Related Links

Featured Links





Recommended Products



 

 
Featured Articles

Becoming An Affiliate Marketer
Becoming an affiliate marketer is an interesting and exciting process. There are so many programs out there for you to promote. You should think seriously before you commit to any one program. Choosing A Program To become an affiliate marketer, you must ...

Free ISP
The Ins and Outs of Free ISPs Yes, Virginia, there are companies that offer free Internet service. The common definition of an ISP is a company that provides Internet access, usually for some kind of fee. The amazing part is that there are actually ISP ...

Tips on understanding the dangers of spyware and adware
Adware is a program that displays advertisements on the computer whether you want them or not. They are not just connected to particular websites or free software but are programmed to start up whenever your computer is switched on. Programs like ...


Google
Force the download, hide the path
 

This is an article about providing downloads on a website. It describes common webmaster issues when it comes to file downloads and it will discuss several solutions. Some of them are easy to implement, others require a little technical background and programming skills. But in the end, everyone will have a suitable solution for his problem.

If someone wants to provide a download on his website, one can find following instruction note beside the link:

Right click on the link and from the context menu, select "Save Target As" in Internet Explorer or "Save Link As" in Netscape/Mozilla.

If you search in Google for "right click" "save link as" OR "save target as", you will get around 1,750,000 search results. It seems to be very common in the web.

The reason for this is that several file types are opened directly within the browser window (JPG, GIF, MP3, MPG, AVI, PNG, TXT, PDF, and of course HTML). Other file types start an extern application (XLS, DOC, PPT). It depends on the operating system, the browser software and the plugins the visitor has installed and while opening those files instantly might be the intended behavior in many cases, sometimes you want a file to be downloaded.

One solution could be to pack the file as ZIP or GZIP archive. In fact you should pack all your download files because it can save your bandwidth and reduce the download time for your visitor. On the other hand, packing files like JPG, GIF, MP3, or AVI does not make much sense because these file formats are pack formats itself. Packing these files into a ZIP file will not reduce the file size significantly in most cases.

What is the downside of a pack format like ZIP or GZIP? Not everyone has a software to unpack them on his local computer and therefore you would loose some of the target audience. Especially when it comes to visitors with little experience in using the internet, you end up writing support e-mails instructing visitors how to unpack the ZIP or GZIP archive.

Another solution would be server side scripting. Scripting languages like PHP provide the possibility to tell a browser not to open a file but download it to the visitor's local computer.


These scripts force the browser to open the save file as dialogue automatically.

If you have some programming skills, you can go to php.net (http://www.php.net/header), get all the needed information there and write a tool that serves the download file to the visitor along with the instructions to force the browser to open the download dialogue.

If you do not have the programming skills, you are either lucky to know that programming guy above or to know websites like STADTAUS.com. Those websites offer "ready to use" CGI or PHP scripts for implementing in your own website.

STADTAUS.com (http://www.stadtaus.com/en/) created such a tool in 2003 and has improved it as user feedback came in. That tool, named Download Center Lite (http://www.stadtaus.com/en/php_scripts/download_center_lite/), is a small package that needs to be installed on your web server. You only need to define the path to your download files directory and do some other optional configuration.

Once installed you can link to the script and attach the name of your download file to the link URL using a question mark:

http://www.example.com/download_center/?my_file.pdf

The script looks up the file name within the download folder and outputs it to the visitor. Download Center Lite has been tested and proven to work with small (few KByte) and even large files (over 100 MByte).

Another important built in feature is that the script hides the real download path. That prevents the visitors from accessing your download directory directly. You could even place the download folder outside of the www root folder.

Admittedly, while most of the web browsers on most of the operating systems work fine with the script, there are some exotic combinations of browsers and operating systems that will still open the file directly instead of opening the save as dialogue. Fortunately, these browsers (i.e. IE 4) have a very small market share, so no need to worry about that much.

http://www.stadtaus.com/en/php_scripts/download_center_lite/
http://www.stadtaus.com/en/


About the Author
The author is a freelance software developer and web designer (http://www.stadtaus.com/).

News



MP3 Toolkit
PCWorld (blog)
MP3 Toolkit is simple and it works, letting you convert audio files to a number of different types, merge multiple files into one, clip files for ringtones or the like, edit tags, rip files from CD, and record using a microphone.

and more »

MP3 ROUNDUP: Savages, Indian Wells, How To Dress Well, The Child of Lov ...
ChartAttack
by CHARTattack Primal aggression and intensity, London four-piece Savages' caustic post-punk is musically and emotionally raw. They've been tearing it up for months with live shows, but they have a 7” on the way, and below is the fantastic B-side ...


Jill on Money: Real estate, munis, life insurance
CBS News
Download the podcast on iTunes Download the podcast on feedburner Download this week's show (MP3) The Facebook IPO hype morphed into a fiasco throughout the week, diverting attention away from more pressing issues. To understand the issues surrounding ...


Creating a Custom iTunes Audiobook From Multiple MP3s
About - News & Issues
Rather than wasting time (and possibly money) on third-party software, you might find that the facility in iTunes to combine multiple MP3 files into one audiobook could be the perfect solution. Using this often overlooked feature enables you to create ...

and more »

RollingStone.com

MP3 Download: The Mynabirds' Soulful, Optimistic 'Body of Work'
RollingStone.com
By Rolling Stone The Mynabirds have opened up their sound on their second album, GENERALS, adding electronic textures and unexpected sounds to their established foundation of blue-eyed soul and gospel. "Body of Work," a highlight from the new disc, ...

and more »