Rodster001 has asked for the wisdom of the Perl Monks concerning the following question:
This posting is somewhat of a continuation of this thread.
To summarize, when the attachment header is sent to IE choosing "save" from the dialogue box works but "open" sometimes (depending on the system) results in the file "not found". This has something to do with the cache in IE (I believe).
The update is that Google's analytics site has a pdf export option for each of its report pages. This works flawlessly (choosing open or save when prompted by the dialogue box). I am guessing that Google is sending something else in the header which I am not that is making theirs work. But, since the site is secure and requires a form based login I can't easily see the header they are sending (by telneting to port 80 for example).
This is my code snippet that is not working.
Any ideas? Thanks!use CGI; my $f; open (OUT,"somefile.pdf") or print STDERR "Can't open $!"; while (<OUT>) { $f .= $_; } close (OUT); my $l = length($f); print CGI->header( -type =>"application/octet-stream", -expires=> '+3d', -charset=>'utf-7', -Content_length => $l, -attachment => "example.pdf", ); print $f; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTTP Attachment Header
by ikegami (Patriarch) on Jan 16, 2009 at 19:37 UTC | |
by Rodster001 (Pilgrim) on Jan 16, 2009 at 19:43 UTC | |
by ikegami (Patriarch) on Jan 16, 2009 at 19:47 UTC | |
|
Re: HTTP Attachment Header
by Corion (Patriarch) on Jan 16, 2009 at 19:41 UTC | |
by Rodster001 (Pilgrim) on Jan 16, 2009 at 20:51 UTC | |
by Anonymous Monk on Jan 17, 2009 at 11:05 UTC | |
by Rodster001 (Pilgrim) on Jan 16, 2009 at 19:50 UTC |