Click here to Skip to main content
15,880,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I my project i have implement a link with . its working fine in Chrome Browser. But now my requirement is that how can i implement with the same as in internet Explorer. i tried a lot with document.execCommand("SaveAs", false, ""); but not exactly got it.

Help me , Thankx in advance.
Posted

Hi
Can you please use following:
JavaScript
window.open('complete your file path');

it will ask for download or open file in new window.
 
Share this answer
 
This is for IE

JavaScript
f ( !! window.ActiveXObject && document.execCommand)     {
        var _window = window.open(fileURL, '_blank');
        _window.document.close();
        _window.document.execCommand('SaveAs', true, fileName || fileURL)
        _window.close();
    }
 
Share this answer
 
Comments
Anshulkumar608 8-May-14 8:15am    
Thanx Karthik Chintala for your replying.

I have implemented as


function SaveToDisk() {

var fileURL = 'http://belnet4admin.beltoneapps.com/Docs/Miniclip_Avatar.png';
// for IE
if (!!window.ActiveXObject && document.execCommand) {
alert("a");
var _window = window.open(fileURL, '_blank');
_window.document.close();
_window.document.execCommand('SaveAs', true, fileURL)
_window.close();
}


But it open only a blank Screen
I can't elaborated on my project . can you please provide me a simple demo.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900