Reputation: 605
I need to provide a download link to the user to download a video. When I visit the link using firefox, it starts playing instead of downloading.
How can I force firefox to download it?
Upvotes: 0
Views: 1370
Reputation: 11
lol right click on link instead of left click and choose option save link as ..
Upvotes: -1
Reputation: 2259
You have to set some HTTP headers. Example in PHP:
header("Content-Disposition: attachment; filename=" . urlencode($file));
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
Upvotes: 3