Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

(ar0n) Re: Not Strictly A perl question.

by ar0n (Priest)
on Jun 30, 2001 at 22:34 UTC ( #92943=note: print w/replies, xml ) Need Help??


in reply to Not Strictly A perl question.

That would almost work, provided you'd send the correct headers:
#!/usr/bin/perl -wT use strict; use CGI ':all'; my $q = new CGI; my $imagedir = "/path/to/images"; my $file = $q->path_info(); $file =~ s!^.*/!!gi; print header("image/jpeg"), do { local *ARGV; @ARGV = "$imagedir/$file"; <> };
Be sure to use taint checking on your path info, as you wouldn't want anyone to view files they shouldn't be viewing... :)

ar0n ]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://92943]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2023-12-09 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (38 votes). Check out past polls.

    Notices?