Display file "Open, save as" dialog before downloading the file
Hi,
I am trying for download files (doc, xls, pdf,ppt) using jQuery. I have the full path of the filename, which I am now passing to window.url.
Problem is the file is directly getting opened, but I would like to show the "Open, save as " Popup.
Below is the code used:
- // aspx
<input type="button" id="filesDownload" value="Download" />
- // Sepearate JS file:
$('#filesDownload).click(function () {
- InvokeDownloader();
- });
-
function InvokeDownloader() {
var filename = currentItem.get_item('FileLeafRef'); // I get the Name of file
- var dir = currentItem.get_item('FileDirRef'); // I get the file path
- var imgfilename = dir + '/' + filename;
- window.location = imgfilename;
}
How to show the "Open, Save as" dialog box and when user clicks on the save download the file?
Thanks