in reply to Re: saving pages all= index.pl.html
in thread saving pages all= index.pl.html

Hi PodMaster, I found this How do i return a file with CGI and suggest a file name to 'save as' in "Q&A > CGI programming" :)

Ciao, Valerio

  • Comment on Re: Re: saving pages all= index.pl.html

Replies are listed 'Best First'.
Re: Re: Re: saving pages all= index.pl.html
by PodMaster (Abbot) on Feb 15, 2003 at 16:50 UTC
    Oh I get it now. So zentara wants another link next to print, xml, save, which would use Content-Disposition ... so a user can "save target as" and save it with the neato filename. We can do that.

    update: Or we can send the Content-Disposition header with every request. I haven't checked the RFC, but IE does not respect the filename specified via Content-Disposition, while Mozilla does. I'm not sure how it's supposed to work.


    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.

      I have been using:
      print $q->header(-type=>$type, -Content_Disposition=>"filename=$node-> +{title}"); print $$data;
      ...with a script that grabs files (mostly photographs) from a database and sends them to the browser. After determining the mime.type and verifying the data, of course.
      I have never had IE not respect the filename I sent it.
      This is running from Apache/1.3.26 (Unix).
      -xtype

      P.S. Oh, and I agree with this post, except that I would like an option between the node ID or the node Title (set in user prefs). Maybe it would default to node Title for the Anons. pmdev...get to work.

      update: Also, I would like to see it sent with every request. I see no need for a "save" link.