Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > myfile.cgi?image.gif saved as myfile.cgi in mozilla?

Reply
Thread Tools

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

 
 
joe
Guest
Posts: n/a
 
      04-29-2004
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.
 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      04-30-2004
joe <(E-Mail Removed)> wrote:

> any suggestions?



Post Perl questions in the Perl newsgroup.

Post browser questions in a browser newsgroup, such as:

comp.infosystems.www.browsers.mac
comp.infosystems.www.browsers.misc
comp.infosystems.www.browsers.ms-windows
comp.infosystems.www.browsers.x


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
 
Robin
Guest
Posts: n/a
 
      04-30-2004

"joe" <(E-Mail Removed)> wrote in message
news:Xns94DAC811B1E5Fjosephthecianet@207.69.154.20 2...
> 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


 
Reply With Quote
 
Mark Clements
Guest
Posts: n/a
 
      04-30-2004
Robin wrote:
> "joe" <(E-Mail Removed)> wrote in message
>>Hi i have a pl file that prints


>>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

> 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
 
Reply With Quote
 
Sherm Pendley
Guest
Posts: n/a
 
      04-30-2004
Robin wrote:

> "joe" <(E-Mail Removed)> wrote in message
> news:Xns94DAC811B1E5Fjosephthecianet@207.69.154.20 2...
>> 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?

>
> 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--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
 
Reply With Quote
 
Alan J. Flavell
Guest
Posts: n/a
 
      04-30-2004
On Fri, 30 Apr 2004, Sherm Pendley wrote:

> Robin wrote:
>
> > check your query string parse code first.

>
> Robin, were you born stupid or do you have to work at it?


Please resist the temptation to feed the trolls.
 
Reply With Quote
 
Joe Smith
Guest
Posts: n/a
 
      04-30-2004
Peter Payne wrote:

> 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
 
Reply With Quote
 
Joseph
Guest
Posts: n/a
 
      05-12-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saved Mail Gone and Sent Mail Not Being Saved Gregg Firefox 6 03-06-2006 02:13 AM
updating firefox 0.8 to current-are settings saved & are PDF openingprob's cured yet? dave Firefox 1 08-06-2004 12:59 PM
Saved webpages, URL coding doesn't work in FF. Any solution? Galaxy Firefox 0 07-23-2004 01:19 PM
How to delete a password without deleting saved mail? ParaMind Brainstorming Software Firefox 6 05-25-2004 09:03 PM
Migrate Saved Passwords? Christian Dornes Firefox 3 12-04-2003 07:02 PM



Advertisments