0

I have created a script that generates direct url to download a mp4 file.The problem is that download managers don't catch the correct title.

<a href="<?php echo $mp4_720p; ?>">"><?php echo $title; ?></a>

$mp4_720p --> the url of the mp4 file .This is dynamic and is unique for each downloader.

$title-->It is the name of the video file

The problem is that my download manager (IDM) recognise the file name as videoplayback.mp4 when i want it to be $title.mp4

Is there anything i am missing here in the html ??

UPDATE I found a nice html5 solution that works

<a href="<?php echo $mp4_720p; ?>" download="<?php echo $title; ?>"><?php echo $title; ?></a>

Browser takes the title as the filename as expected but unfortunately Download Managers are still unable to pick up the correct filename

Regards

user2650277
  • 6,289
  • 17
  • 63
  • 132
  • is your php script doing `header("Content-Disposition: attachment; filename='$title.mp4'");` ? – AD7six Feb 20 '14 at 11:06
  • Just to exclude the obvious: can't you rename your file from `videoplayback.mp4` to `$title.mp4`? – Carsten Feb 20 '14 at 11:06
  • @ AD7six Nope i am not sending any Content-Disposition header in my script atm. – user2650277 Feb 20 '14 at 11:25
  • @Carsten i can't rename since the link generated is not from my server @ – user2650277 Feb 20 '14 at 11:25
  • Then yoy can't do what you ask - especially since the file isn't on your sever. The title of a link pointing at a url has no bearing at all on what the downloaded file (if the link triggers a download) is called. – AD7six Feb 20 '14 at 18:13
  • Please check **UPDATE ** guys i found a partial html5 solution – user2650277 Feb 21 '14 at 06:57

0 Answers0