1

Is it possible to force a Chrome (and maybe other browsers) to save "mpg" file link instead of trying to open it in build-in media player via html code (and not changing settings of the browser)? I could do that via PHP with additional headers, but those files are really huge sometimes, so sending them via php wouldn't be too wise.

Before getting millions of -1s, just wanted to say that I know this is really simple question, but couldn't find an answer anywhere. Maybe it's just impossible?

Flash Thunder
  • 11,672
  • 8
  • 47
  • 91
  • Ignore me, I was confusing LINK element with A HREF; there seems to be a solution with HTML 5. Check, it may be duplicate. http://stackoverflow.com/questions/11353425/force-a-browser-to-save-file-as-after-clicking-link – Dane Balia May 28 '14 at 19:36
  • @DaneBalia Thank you, `download` attribute worked. You may add an answer if you want, and I will accept it. I won't remove this question, as I couldn't find that answer myself, so even if it is a duplicate, may help someone. – Flash Thunder May 28 '14 at 21:49

1 Answers1

2

There seems to be a solution with HTML 5 (download attribute):

<a href="path/to/file" download>Download Now</a>
Dane Balia
  • 5,271
  • 5
  • 32
  • 57