/    Sign up×
Community /Pin to ProfileBookmark

How to provide "download video" link

Hi,

I’m trying to allow users to download a video from our site but am running into issues with IE and Firefox. When I simply link to the .mov file, I am unable to get the “Save File As” popup to appear and the video simply starts running in the browser. I would like to avoid forcing the user to right click on the link. I’ve also tried passing the action=save variable but that no longer works. Does anyone have any suggestions?

Thanks!

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@d3sc3n7Aug 31.2007 — Just a idea...probably not the best one. Place a link under the video (or where ever) link it to a .zip file of the video. I.E link = /directory/video.zip

That should enable it to download. (yes I posted a download question earlier, but figured it out)

As I said, not the greatest way...but should work at least
Copy linkTweet thisAlerts:
@sridharrAug 31.2007 — Its a good idea to put the file as a zip.

But I would have used a server side script like PHP / ASP. With PHP you can actually say how the file link is handled. You can force the download.

For an idea, you can refer: http://www.php-mysql-tutorial.com/upload-to-file-server.php

Regards,

Sridhar
Copy linkTweet thisAlerts:
@T1963authorAug 31.2007 — I appreciate both your help on this. Unfortunately, I know nothing about PHP -- that would have been a good option. The zip does do the trick -- good thinking! However, if anyone else has a method that doesn't involved having to unzip the file, I'd appreciate your thoughts as well.

Thanks again!
Copy linkTweet thisAlerts:
@d3sc3n7Aug 31.2007 — Yeah, I figured the problem behind upzipping the file would be there. Um, also put a link to winzip.com? lol!

I know of other ways to get the video...but they involve browser add-ons, and third party programs.
Copy linkTweet thisAlerts:
@jessnoonyesSep 02.2007 — Try this:

Paste this code into a new Notepad page and save it as "download.php". Change the "whatever.mpg" to the name of the file you want downloaded:

<?php

$filename = "whatever.mpg";

header("Content-Length: " . filesize($filename));

header('Content-Type: application/octet-stream');

header('Content-Disposition: attachment; filename=whatever.mpg');

readfile($filename);

?>

Then add this wherever you want the download link to go:

<a href="download.php">Download Now!</a>
×

Success!

Help @T1963 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...