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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript save as

    Hi

    I was wondering if anybody knows a way of making javascript bring up the "save as" box. I want to make my page so you can click on an image and the save as box being brought up instead of having to right click and select save as.

    any help is appreciated.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,641
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Javascript has no file access whatever and so has nothing to "save as".

    The way to get a link to offer the "save as" option is to assign an undisplayable MIME type to the file to be downloaded so that the browser can't display it and therefore offers it for download instead. How you set this up depends on your server configuration.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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