#!/usr/bin/perl -w use CGI qw(:standard); print header; print start_html('Download'), h1('Download'), start_form, p, "Feet? ",textfield(-name=>'feet', -size=>5), "Inches? ",textfield(-name=>'inches', -size=>5), p, submit(-value=>'Create File'), end_form, hr; if (param()) { $feet=param('feet'); $inches=param('inches'); $filename=param('feet') . param('inches') . '.txt'; $tape = < "application/octet-stream", # -charset=>'UTF-8', # -attachment=>$filename); # print $tape, print "Content-Type: application/octet-stream; name=$filename\n"; print "Content-Disposition:attachment; filename=$filename\"\n\n"; print $tape; }