Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Save as?

  1. #1
    New to the CF scene
    Join Date
    Nov 2003
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Save as?

    Hello,

    Is there a JS function to save a file (ASP in my case) as html
    on the user PC, the user need to click on the link\button and the
    "save as" window open, is this possible? (the user menu is invisible)

    I'm generating a OL PO that can be printed but
    the I wold like "Save as" option will be available.

    Thanks.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    IE-only:

    document.execCommand('SaveAs',false,'.html')

    This, however, will save the currently loaded page; if you wanted the user to simply download the .asp file without actually displaying it, you'd need to load it into something (frame/iframe/popup) first. Can't say as I've done that, but it works for printing undisplayed files.

  • #3
    New to the CF scene
    Join Date
    Nov 2003
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by adios
    IE-only:

    document.execCommand('SaveAs',false,'.html')

    This, however, will save the currently loaded page; if you wanted the user to simply download the .asp file without actually displaying it, you'd need to load it into something (frame/iframe/popup) first. Can't say as I've done that, but it works for printing undisplayed files.
    Thanks, that is what I was looking for, however the
    "IE-Only" is a small problem that I have to deal with all the time...

    ( for all the "other" browsers )


  •  

    Posting Permissions

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