PDA

View Full Version : Code For Video Download


HailttRedskins
January 28th, 2007, 05:56 AM
Hopefully someone can help me on here. This forum has been a great help so far with helping me out with 2 problems I have had, and hopefully this will be a 3-0 victory.

I run a website for fun, have some videos and such on it. What I want to do, is have it so when you click the video you want. Instead of it actually opening the video in your video player (Streaming the file), it pops up with a box, giving you the option to open, save, or cancel.

For instance:

http://www.tourettesguy.com/videos/download/dl.php?v=bobsaget

When you click that link, it gives you those options.

I was wondering if anyone happend to know the code of that, and would be able to help me out with it.

Thanks

renegade600
January 28th, 2007, 06:04 AM
my suggestion would be to look at the page source and see how it was coded.

HailttRedskins
January 28th, 2007, 07:36 AM
This is what it says

<center>Right click <a href="http://www.tourettesguy.com/videos/download/dl.php?v=tuba">here</a> and click 'Save Target As...'
to save
this
to your computer.

But I think theres some special codes in that php dl.php

30111987
January 28th, 2007, 11:05 AM
<?php
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="myfile.pdf"');
?>


That's based on a pdf, you will have to modify it for a wmv ;)
more here: http://uk.php.net/header

degsy
January 28th, 2007, 01:55 PM
If you are using PHP then here is a script
http://elouai.com/force-download.php

and one for ASP
http://forums.aspfree.com/code-bank-54/download-manager-downloading-files-from-secure-location-classic-asp-65239.html


look for force download or download manager scripts.

HailttRedskins
January 29th, 2007, 05:05 PM
<?php
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="myfile.pdf"');
?>


That's based on a pdf, you will have to modify it for a wmv ;)
more here: http://uk.php.net/header

Thats exactly what I needed, thanks!

And thank you to everyone else who helped.