www.webdeveloper.com
Results 1 to 3 of 3

Thread: Save Dialog for zip file

  1. #1
    Join Date
    Jul 2011
    Posts
    3

    Save Dialog for zip file

    The below code is working for the text file but not for the zip. I want to create a Save dialog option to save zip file. any help is greatly appreciated.

    <html>
    <body>
    <script language='javascript'>
    function downlodMyFile( MyFile ){

    document.execCommand('saveas',false, MyFile);

    }
    </script>

    <button onclick="downlodMyFile('source.zip')">Download My File</Button>
    </body>
    </html>

  2. #2
    Join Date
    Jul 2011
    Posts
    3
    Additional Information:-

    This code works in FireFox and it is not working in IE 8

  3. #3
    Join Date
    Jul 2011
    Posts
    3
    I saw this snippet in on the JS forum. can someone help me to change this code to download zip file.

    function ShowSaveComplete() {

    if (document.all) {

    var OLECMDID_SAVEAS = 4;
    var OLECMDEXECOPT_DONTPROMPTUSER = 2;
    var OLECMDEXECOPT_PROMPTUSER = 1;
    var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";

    document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
    WebBrowser1.ExecWB(OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER);
    WebBrowser1.outerHTML = "";

    } else {

    alert("This is only applicable to Internet Explorer");

    }

    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles