Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Secure Download naming and default behavior


Hello, I'm following the steps described in the following link (http://support.jwplayer.com/customer/portal/articles/1433647-token-signing-with-jw-platform) in order to create a secure link for users to download some of our videos. We then use the link in a regular a tag for the user to click. The link and expiration times are created correctly but there are two things we would like to change:

1) When the user clicks on the link, the video opens in the browser instead of downloading. In order to download, the user needs to right click on the link and choose "Save Link as". Is there a way to have the download start automatically instead?

2) When the user chooses to download, the filename for saving is the code of the video+code of the player. Is there anyway to prepare that filename with the name of the video?

Thanks.

CPG

2 Community Answers

O...

User  
0 rated :

In the end I figured this out. Instead of using a link, I used a form with a button. The form passed the secure link and the name of the file I wanted to a separate PHP file:

<?php
header('Content-type: application/mp4');
header('Content-disposition: attachment; filename='.$_POST['file'].'.mp4');
readfile($_POST['link']);
?>

This causes the video to automatically download with the specified filename.

Cooper Reid

JW Player Support Agent  
0 rated :

Glad you were able to get this resolved
Cooper

This question has received the maximum number of answers.