SaveAs, revisited

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Captain Dondo

    SaveAs, revisited

    I'm a total javascript newbie, but I've figured out that a true
    cross-platform way to initiate a 'SaveAs' dialog doesn't exist.

    So... I'm searching for the most 'elegant' way to do this:

    I pop up a window with a picture in it. The picture is a Thumbnail for
    the full-size digital image. The fullsize digital image is too big to fit
    on a typical user's screen.

    What I would like is to prevent the browser (any browser, I know I have to
    support IE, FireFox, and Mac-Safari at a minimum) from opening this jpeg
    image in a new window, and instead ask the user if s/he wants to save the
    file.... Doable? I guess what I am trying to do is turn off the automatic
    mime-type handling for this one operation.....

    Failing that, I am looking for the most elegant way of handling this. I
    really don't want users to get a window that is 2 or 3 times their screen
    size, just to save the file.....

    Any thoughts?

    --


    use munged address above to email me
    SpamTrap DoMeNow@seiner. com

  • David Given

    #2
    Re: SaveAs, revisited

    Captain Dondo wrote:
    [...][color=blue]
    > What I would like is to prevent the browser (any browser, I know I have to
    > support IE, FireFox, and Mac-Safari at a minimum) from opening this jpeg
    > image in a new window, and instead ask the user if s/he wants to save the
    > file.... Doable? I guess what I am trying to do is turn off the automatic
    > mime-type handling for this one operation.....[/color]

    Use a CGI script that emits an application/octet-stream MIME type and then
    cats the image data.

    Alternatively, don't: I can't speak for anyone else, but this behaviour
    would really annoy me. I may not *want* to download the file; I'd much
    rather have my web browser do the thing that I set it up to do, which is
    currently to display the image in a scaled window. If I want to save it I
    can ask it to save it. Other people might have their browsers set up to
    load it into Photoshop or the GIMP or some such thing.

    As a general rule, trying to override bits of browser behaviour is not
    considered friendly...

    --
    +- David Given --McQ-+ "The sky was the perfect untroubled blue of a
    | dg@cowlark.com | television screen, tuned to a dead channel." ---
    | (dg@tao-group.com) | Neil Gaiman, _Neverwhere_
    +- www.cowlark.com --+

    Comment

    • Captain Dondo

      #3
      Re: SaveAs, revisited

      David Given wrote:
      [color=blue]
      > Use a CGI script that emits an application/octet-stream MIME type and then
      > cats the image data.
      >
      > Alternatively, don't: I can't speak for anyone else, but this behaviour
      > would really annoy me. I may not *want* to download the file; I'd much
      > rather have my web browser do the thing that I set it up to do, which is
      > currently to display the image in a scaled window. If I want to save it I
      > can ask it to save it. Other people might have their browsers set up to
      > load it into Photoshop or the GIMP or some such thing.
      >
      > As a general rule, trying to override bits of browser behaviour is not
      > considered friendly...
      >[/color]

      Well, the idea is to have "Print", "Email", and "Save" buttons, that
      each do what they're supposed to.... Basically, the images are already
      displayed in 640x480 resolution, and then the question is "what now"?
      From your comments, I think I should add "Open full" as well, and let
      tech-savvy people do what they want.

      This is for fairly non-technical folks, so I am trying to make it very
      idiot proof.... They're always free to right-click and save the 640x480
      image any way they choose.

      I have the basic skeleton worked out, but so far the combination of
      javascript and PHP is turning out to be one ugly hack.... Oh well,
      "prepare to throw the first attempt away, you will anyway." :-)

      Comment

      Working...