#!/usr/bin/perl #↑パールのアドレス(@ニフティ#!/usr/local/bin/perl)(インフォウェブ#!/usr/bin/perl) # あなたが加入しているプロバイダの「perl」言語が使用できる # パスを指定します。一般的「#!/usr/local/bin/perl」が多い $image_url = "./img1"; #locationの場合はhttp://から #set method location or print #$method = "location"; $method = "print"; $buffer = $ENV{'QUERY_STRING'}; @pairs = split(/&/,$buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $FORM{$name} = $value; } $img = "$FORM{file}"; $img = "$image_url/$img"; #retern the image. choose a method. if($method eq "location"){ print "Location: $img\n"; print "Pragma: no cache\n"; print "Expires: Sun, 23 Oct 1999 16:00:GMT\n\n"; exit; }else{ print "Content-type: image/jpeg\n\n"; open(IMG, "$img") || die "Can't open: $img"; binmode(IMG); binmode(STDOUT); print $_ while (); close(IMG); exit; }#end exit;