SHARE
TWEET

Untitled

a guest Nov 19th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. function save_content_to_file(content, filename)
  3. {
  4.     var dlg = false;
  5.     with(document){
  6.      ir=createElement('iframe');
  7.      ir.id='ifr';
  8.      ir.location='about.blank';
  9.      ir.style.display='none';
  10.      body.appendChild(ir);
  11.       with(getElementById('ifr').contentWindow.document){
  12.            open("text/plain", "replace");
  13.            charset = "utf-8";
  14.            write(content);
  15.            close();
  16.            document.charset = "utf-8";
  17.            dlg = execCommand('SaveAs', false, filename+'.txt');
  18.        }
  19.        body.removeChild(ir);
  20.      }
  21.     return dlg;
  22. }
  23.  
  24.  
  25. save_content_to_file("Hello", "C:\\test");
  26. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top