SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: File saving

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    File saving

    hello friends,

    i have the following code:

    <a href="#" onclick="javascript:document.execCommand('saveas','1',null);"><script language="JavaScript1.2">document.write('<img src="graphics/bullets/computer/floppy_disk_rotation_med.gif" border=0 width=32 heigth=15 alt="Click to Save this Panel">');</script></a>

    when the image is clicked it does bring up a save dialog box, however it saves tghe .html file, how do i change this to save the photo somephoto.gif instead of the whole html document?

    thanks,
    john....

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the following brings up the panel in a window instead of calling the saveas box, what am i doing wrong?

    <script language="JavaScript1.2">document.write('<a href="' + panelfull + '">');document.write('<img src="graphics/bullets/computer/floppy_disk_rotation_med.gif" border=0 width=32 heigth=15 alt="Click to Save this Panel"></a>');</script>

    i was hoping this would display the "SaveAs" dialog box so the user could save the panel if they choose. i even tried the onclick="window.open(panelfull) but it also displays the panel and not the "SaveAs" dialog box.... please help with advice and suggestions.

    thanks,
    john....

  3. #3
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    execCommand is a method of the document object. In order to save the image, the image object would have to support an execCommand method.


Bookmarks

Posting Permissions

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