Greetings Snaps_Provolone,
I read somewhere, I think maybe in the GD::Graph or Spreadsheet::WriteExcel documentation, that it can be done by controlling the CGI header. The examples given in this documentation are similar to:
print "Content-type: application/vnd.ms-excel\n"; print "Content-Disposition: attachment; filename=yourfile.xls\n"; print "\n";
Of course, if you're doing anything with CGI, you should definately use the CGI.pm module. In this case, you might try:
#!/usr/bin/perl -w use strict; use CGI; my $query = new CGI; print $query->header( -type => 'application/vnd.ms-excel', -content_disposition => 'attachment; filename=yourfile.xls' ); binmode STDOUT;
Oh, and that reminds me: that last line is important. Switch to binmode before you print your binary data to the browser.
BTW, what sort of binary data are you trying to send to the user's browser?
-gryphon
code('Perl') || die;
UPDATE: After re-reading your post, I realize now that I'm not exactly answering your question. Sorry. However, let me point out that if you have your script load and print the binary file to the browser rather than redirecting the user, you can more easily control the user experience. A redirect will show the user where you are housing the file(s) s/he wants. I don't know if this is a concern or not, but anyway...
In reply to Re: Processing HTTP file transfers
by gryphon
in thread Processing HTTP file transfers
by Snaps_Provolone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |