This works for me:
#!/usr/bin/perl -w use strict; use warnings; use CGI::Carp qw{ fatalsToBrowser }; use IO::File; my $png = "test.png"; my $fh = new IO::File($png) or die "Can't read file '$png' ($!)\n" +; my $nbytes = (-s $png); binmode $fh; my $data; sysread($fh, $data, $nbytes) or die "Failed to read data from '$png' ( +$!)\n"; print "Content-disposition: attachment; filename=$png\n\n"; print $data;
Update: Removed '...' from .png filename in header.
In reply to Re: Prompt image save
by liverpole
in thread Prompt image save
by DreamT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |