Make video downloadble


#1

I just created a simple html page with an image link to be able to D/L a video I uploaded. Problem is, when I click on the image, another tab opens and it looks like Quicktime is trying to launch.

Hoe do I just make it such that when a user clicks on the image, it will allow download?

The html I have is:

<img border=“0” src=“PSPOALOGO.jpg”

alt=“PSPOA”>


Click on the logo above to download the video of the opening ceremony. Warning, it is a Huge file and may take a while to download.

a link to what I am talking about is:
http://www.awesomecasinoevents.com/PSPOA/pspoa.html

Thanks in advance.


#2

i just checked my .htaccess and I think i removed that bit. i used to have it for an MP3 lecture i had recorded. there’s a bit of code you can add to your .htaccess that will force a file to be downloaded instead of played. you can do it in php as well. sorry, i can’t remember exactly, but if you search for it, there’s example code out there[hr]

Oh, I think this is it. Make it match the files you want to be downloaded:

<Files *.*> ForceType applicaton/octet-stream </Files>


#3

Maybe this will help, just something I found in a quick google.
http://www.givegoodweb.com/post/30/forcing-a-download-with-apache-and-htaccess

Sometime you don’t want to give your site visitors the option to open a file in their web browser. This could be a Microsoft Office document, or even a giant jpg or png image. When you want to force download a certain file type, simply add something like this to an .htaccess file in the directory that the file(s) are located in:

<Files *.xls>
ForceType application/octet-stream
Header set Content-Disposition attachment

<Files *.eps>
ForceType application/octet-stream
Header set Content-Disposition attachment

This particular directive forces downloads all .xls and .eps files (the * means match any file name, followed by the extension of the file) in the same directory, as well as any sub-directories, and ensures that the browser will not try to open the file.

In general, I like to avoid putting such things in my root .htacess file, preferring to create a “downloads” directory of some sort, and just adding the above lines as needed. Some servers are different, so your mileage may vary - check the comments below.


#4

Thanks so far. I did create a .htaccess file containing only the following:

<Files *.mpg>
ForceType application/octet-stream
Header set Content-Disposition attachment

However, using Filezilla, I am unable to transfer this to the directory on Dreamhost. At least I think it does not transfer. Filezilla says transfer complete but I cannot see the file on the server side.

Wait… I guess it did work as it forces a download dialog.

Wonder why I cannot see the .htaccess file?


#5

A lot of FTP clients will automatically hide files with names starting with dots. You may have to change some options to make it show up.

You also can’t download .htaccess files over the web. Security precaution. :slight_smile:


#6

Thanks to everyone… problem solved. The .htaccess file made the mpg downloadble and adjusting the Filezilla serversetting make the hidden file viewable.

Thanks again.