Click here to Skip to main content
14,388,768 members
Rate this:
Please Sign up or sign in to vote.
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
Rate this:
Please Sign up or sign in to vote.

Solution 1

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

it will ask for download or open file in new window.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

This is for IE

f ( !! window.ActiveXObject && document.execCommand)     {
        var _window = window.open(fileURL, '_blank');
        _window.document.close();
        _window.document.execCommand('SaveAs', true, fileName || fileURL)
        _window.close();
    }
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100