# Javascript: Force Download?

**URL:** <https://forum.kirupa.com/t/javascript-force-download/101160>\
**Category:** Uncategorized\
**Created:** [February 6, 2004, 4:37pm UTC](https://forum.kirupa.com/t/javascript-force-download/101160 "2004-02-06T16:37:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrand01](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@mrand01](https://forum.kirupa.com/u/mrand01)\
**Post date:** [February 6, 2004, 4:37pm UTC](https://forum.kirupa.com/t/javascript-force-download/101160/1 "2004-02-06T16:37:19Z")

</div>

I’m trying to make Javascript force a download, but I don’t know how. Here is my current function:

```auto

function saveFile() {
	var list = document.playerCtrl.downloads;
	var downloadURL = list.options[list.selectedIndex].value;
	window.location.href = downloadURL;
}

```

all of the downloadURLs are pointed to WMVs (videos) on a server. This (of course) automatically opens Windows Media Player. Is there any way for me to force a right click/save as?
