myfile.cgi?image.gif saved as myfile.cgi in mozilla?

J

joe

Hi i have a pl file that prints
print "Content-type: application/octet-stream\n\n";
and then the output of a file
in ie it works fine the download.cgi?myzip.zip saves the file as myzip.zip
in mozilla however i get the wrong file name i get download.cgi
i tried doing http://www.domain.com/cgi-bin/download.cgi/myzip.zip and i
get the correct name but the contents dont look right any suggestions?
thanks.
 
R

Robin

joe said:
Hi i have a pl file that prints
print "Content-type: application/octet-stream\n\n";
and then the output of a file
in ie it works fine the download.cgi?myzip.zip saves the file as myzip.zip
in mozilla however i get the wrong file name i get download.cgi
i tried doing http://www.domain.com/cgi-bin/download.cgi/myzip.zip and i
get the correct name but the contents dont look right any suggestions?
thanks.

check your query string parse code first.
-Robin
 
M

Mark Clements

Robin said:
check your query string parse code first.
What query string parse code? The only application doing any query
parsing for the purposes of this exercise is mozilla, and I doubt that
you are suggesting he check the source code of that.

Mark
 
S

Sherm Pendley

Robin said:
check your query string parse code first.

Robin, were you born stupid or do you have to work at it? To begin with, no
one in their right mind is going to be using their own parsing code.
Second, query string parsing doesn't have *one* *damn* *thing* to do with
this problem.

Joe, in theory what you need is to return a Content-Disposition header as
part of your response. It appears to have some problems in practice though.
See this page for discussion:

<http://www.hanselman.com/blog/PermaLink.aspx?guid=360>

And these are the relevant standards docs:

<http://www.faqs.org/rfcs/rfc1806.html>
<http://www.faqs.org/rfcs/rfc2183.html>

sherm--
 
J

Joe Smith

Peter said:
my $s_buffer = undef;
while ( read( EXECGZIP, $s_buffer, 1024 ) )
{
print( $s_buffer );
}

You need to put
binmode STDOUT;
in front of that loop.
-Joe
 
J

Joseph

I found this a couple of days ago.
print "Content-disposition: attachment; filename=$filename\n";
print "Content-type: application/x-download\n\n";

so far it its working in both mozilla and i, with this headers i dont
have to specify file type. thanks for the tips
 

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,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top