AllExperts > General HTML/Web Design Programming Q`s 
Search      
General HTML/Web Design Programming Q`s
Volunteer
Answers to thousands of questions
 Home · More General HTML/Web Design Programming Q`s Questions · Answer Library  · Encyclopedia ·
More General HTML/Web Design Programming Q`s Answers
Question Library

Ask a question about General HTML/Web Design Programming Q`s
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Richard Seltzer
Expertise
How to find what you want on the Internet. How to design your pages so you can be found on the Internet. Use of content to attract traffic to a Web site.

Experience

Past/Present clients
AltaVista, Compaq, Harcourt, Hitachi, and numerous small companies and startups.

 
   

You are here:  Experts > Internet/Online > Personal Web Pages > General HTML/Web Design Programming Q`s > Making visitors download files from my site.

General HTML/Web Design Programming Q`s - Making visitors download files from my site.


Expert: Richard Seltzer - 10/26/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

---------- FOLLOW-UP ----------

QUESTION: This does not work. Giving the file a nonsense extension and directing the link to it led to the file being not detected by the browsers. But I figured out a new idea. I uploaded files in the zipped format (.zip extension) and browsers are giving option to download them. Now visitors of my site only have to download, unzip and use the files.

Answer
That's an excellent solution.  Congratulations on coming up with it, and thanks for letting me know.  I'll keep that in mind for future occasions when I need to do something similar.

Good luck with your venture.

Best wishes.

Richard Seltzer, seltzer@samizdat.com

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.