in reply to How to send a file vith apache?
if (can_send($file)) { # we assume you can program whatever rules you +need here open(INP,"<$file") || die "Can not open $file:$!\n"; # but handle t +hat in can_send my MIME::Types $types = MIME::Types->new; my $mime = $types->mimeTypeOf($file) || "application/octet-stream"; print header("Content-type: $mime"); binmode(INP); binmode(STDOUT); while (<INP>) { print $_; } close(INP); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to send a file vith apache?
by sgifford (Prior) on May 01, 2004 at 16:04 UTC | |
by matija (Priest) on May 01, 2004 at 17:36 UTC | |
by sgifford (Prior) on May 01, 2004 at 20:27 UTC |