Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to force file download of a known file type

Status
Not open for further replies.

J1mbo

Programmer
Dec 12, 2002
93
US
Hello,

I run a small website ( that hosts mpg video content. How do i force a download prompt to appear instead of media player attempting to play the video when the left mouse button is clicked?

I've asked users to 'right-click' and 'save target as', but this is not helping much.

thanks,

jim
 
What about the mac world - is there a way for the browser to recognize the system and download either a zipped for pc's or a stuffit file for macs??

idaryl
idface.gif
 
is there a way for the browser to recognize the system and download either a zipped for pc's or a stuffit file for macs?? "

Very easily done with PHP/ASP etc etc. But you'd need to have both file versions available for download.

Jim...if you can use PHP or some such server side languages you can force it to download using "content headers".



<!--#sig value=''É'' url='' -->
 
Thanks for the replies.

I will be zipping new content on the site, but this is not possible with the current videos. There are too many. Does anyone have a PHP code snipet or a webpage with an example? thanks,

jim
 
is there a way for the browser to recognize the system and download either a zipped for pc's or a stuffit file for macs??"

why not detect and redirect to corect file format?

JS run it onLoad of page:

function platformDetect()
{ if(navigator.appVersion.indexOf("Win") != -1)
{ alert("Windows"); }
else if(navigator.appVersion.indexOf("Mac") != -1)
{ alert("Macintosh"); } else alert("Other"); }
---------
redirect vs. alert

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top