Perl-CGI: Return HTML and then a file problem

Discussion in 'Perl Misc' started by jon rogers, Jul 2, 2003.

  1. jon rogers

    jon rogers Guest

    Hi

    I run a couple of Perl-CGIs under the latest Apache on my Red Hat box. I
    have now come across a problem.

    From my script, I'd first like to return some HTML lines:

    print "Content-Type: text/html\n\n<html><head><title>The TinyBox
    pages</title>\n";

    etc.

    Then I'd like to return a file:

    print "Content-Type:application/octet-stream
    Content-Disposition:attachment; filename=results.apl
    Content-Length:$content_length\n\n";

    However, it seems that I cannot print
    Content-Type:application/octet-stream after I have printed
    Content-Type: text/html ; the file just gets printed to screen, instead of
    the browser opening a file save requester.

    Is there some way of "resetting" the Content-Type: string sent to Apache, or
    some other way around the problem?

    Thanks for your time,

    JR
     
    jon rogers, Jul 2, 2003
    #1
    1. Advertising

  2. jon rogers

    Zak McGregor Guest

    On Wed, 02 Jul 2003 16:27:02 +0200, jon rogers <"jon rogers"
    <>> wrote:

    Hi

    > Is there some way of "resetting" the Content-Type: string sent to
    > Apache, or some other way around the problem?


    Not a perl question. Ask in comp.infosystems.www.authoring.cgi or
    somewhere else relevant to server-side http issues. But the short answer
    is "No".

    Ciao

    Zak

    --
    ========================================================================
    http://www.carfolio.com/ Searchable database of 10 000+ car specs
    ========================================================================
     
    Zak McGregor, Jul 2, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mufasa
    Replies:
    7
    Views:
    426
    Alexey Smirnov
    Sep 4, 2007
  2. AAaron123
    Replies:
    1
    Views:
    1,014
    Alexey Smirnov
    Nov 17, 2009
  3. Replies:
    0
    Views:
    313
  4. kath
    Replies:
    4
    Views:
    703
    J. Gleixner
    Apr 9, 2007
  5. Replies:
    4
    Views:
    551
    cwdjrxyz
    Jan 17, 2006
Loading...

Share This Page