#!/usr/local/bin/perl # java file saver: stuff data for retrieval by browser $name= "tmp/test.pict"; $path=$ENV{"SERVER_PATH"}; $host=$ENV{"SERVER_HOST"}; $port=$ENV{"SERVER_PORT"}; $file=$path . "/" . $name; $fileurl="http://$host:$port/$name"; open(FILE, ">$file"); while (<>) { print FILE $_; } close(FILE); print "Content-type: text/html\n\n"; print "$fileurl\n";