Perl-CGI: Return HTML and then a file problem

J

jon rogers

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
 
Z

Zak McGregor

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

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top