| |
You are here: Experts > Internet/Online > Personal Web Pages > General HTML/Web Design Programming Q`s > Making visitors download files from my site.
Expert: Richard Seltzer - 10/24/2009
Question QUESTION: Dear Richard,
I own a domain and some space on internet. For the facilities offered by my host please checkout this link http://www.inmotionhosting.com/cheap_hosting.html. I have chosen the 'Basic' plan ($4/month). My programming knowledge is limited to basic html. I want to make a site from where people can download files like .pdf, .doc, images, audios, videos, softwares etc. Could you please tell me the simplest way to do this? If necessary, you can suggest the minimum skills I should acquire before I begin with. And, if you find it very difficult to explain things to a non-programmer, you can use the 'techie' language and leave the understanding part to me. Thanks in advance.
ANSWER: In most cases, if you simply move an unusual type of file to your Web server -- the same as you do .html pages -- the visitor will be prompted to either run or save the file. Experiment. ftp a file of a type that you want to make available to your Web server, and then browse to that page.
For instance, my site is http://www.samizdat.com/ If I upload to my base Web directory a file of a type that my browser doesn't recognize, e.g. samplemusic.mp3, then anyone who goes to http://www.samizdat.com/samplemusic.mp3 will have a choice of playing that with another application or saving it. And if it's a file that my browser recognizes (like .doc or .pdf), that file will open in the browser and I can then save it as I would any other file.
Best wishes.
Richard Seltzer
---------- FOLLOW-UP ----------
QUESTION: Thank you for such a quick and detailed answer. I tried doing what you said. Results were not what I expected.
1) PDF files are opened by IE and can be saved from there. But Chrome has problem with even opening the pdf file I have uploaded to my site. (For your information, I have adobe reader 9.2 installed in my PC).
2) Chrome is directly playing 3gp files through real player and doesn't give an option to download, whereas IE started downloading it the moment I clicked the link.
3) In IE, when I clicked the link to an mp3 file in my site, a horizontal bar appeared above the taskbar intimating that file is being downloaded. But a window did not pop-up as in the case of 3gp. Chrome tried to play the file through Quick player giving no option to download.
This is how I placed files in my site:
<a href="theblackhole.3gp">The Black Hole</a>
Is there anything else to be added to the code so that when clicked on a link it readily offers to download the file? Considering the fact that there are numerous browsers with varying properties, could you please advise me a universal solution?
Answer Here's a workaround that will probably work but that you will need to test.
Give each file a nonsense three-letter suffix (something that does not correspond to a real file type).
Then an browser should not recognize it and hence instead of launching an application give the user the opportunity to save the file.
Once the file is saved, change the file name to the right suffix.
If that works for the files you want to post, then tell visitors to your site to rename those files appropriately after saving.
Good luck.
Richard
Add to this Answer Ask a Question
|
|