1

I have a simple question and I don't have a clue that how to achieve that.

When I click a video link even I add a download attribute, Chrome always show video instead of downloading it.

How can I force it to download video or other file types that display on Chrome by default?

Thanks.

Update

In Chrome, you can use Alt+Click to force downloading.

But anyway, I need a way that provide simply click to trigger download instead of playing it and if that way work on every browser that will be the best.

Terry Wei
  • 1,521
  • 8
  • 16
  • You need to define a different mime-type for that file extension. [This](https://stackoverflow.com/questions/1074898/mime-type-of-downloading-file) should be helpful – LS_ Aug 01 '18 at 07:35
  • Do you mean mime-type such as `video/mp4` can't trigger download by default in Chrome? – Terry Wei Aug 01 '18 at 07:36
  • Yes, by default Chrome will autoplay the video. You should try with [application/octet-stream](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#Important_MIME_types_for_Web_developers) – LS_ Aug 01 '18 at 07:56
  • 1
    I can't change the mime-type, is there any other way? – Terry Wei Aug 01 '18 at 07:57

0 Answers0