#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    20
    Rep Power
    0

    'saving image as' with Javascript


    hello,
    I am really curious about if there is a way to add a functionality to my pages that any image file on the page can be 'saved as' with Javascript.
    For ex : clicking on image, runs an 'onclick=savethis(this)', and the known prompt of browser appears 'Where do you want to save this file' ?
    Is there a way ?
    thanks in advance
  2. #2
  3. No Profile Picture
    rubbish in javascript
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    London
    Posts
    706
    Rep Power
    14
    i'm looking cos i'm trying to do this at the mo, so i'll get back to you if i find it...

    a+
    gar
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2002
    Location
    Seattle WA
    Posts
    863
    Rep Power
    14
    JScript doesn't have any file manipulation functions. So, I seriously doubt it.
  6. #4
  7. No Profile Picture
    rubbish in javascript
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    London
    Posts
    706
    Rep Power
    14
    no you misunderstand, i think he just wants to pop the save as box, if he want to save directly he could do that in php.

    a+
    gar
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2001
    Posts
    765
    Rep Power
    13
  10. #6
  11. No Profile Picture
    rubbish in javascript
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    London
    Posts
    706
    Rep Power
    14
    >mrrichardfeder

    had a look and i would be guessing but execCommand('SaveAs') i think is something probably that uses a function on the windows system much as there are execute commands in php that only work on unix, while thats less of a problem for a server in that if you have a unix server because php executes on the server it will work on any client with javascript it would have to be a unix - or in the example you give, windows.

    in a nutshell - that dont work on mac or unix or linux or of course netscape, so bascially ie windows only!

    anyway on a mac it just opens a new window with the image in it.

    a+
    gar

IMN logo majestic logo threadwatch logo seochat tools logo