Jerry Kassebaum wrote: > Friends, > > The cgi below is at http://biblescramble.com/dns/textArea04.cgi. > > If you type lines in the text box, it spits them back when you hit "Submit > Query". > > However, I also want it to spit back a text file. What am I missing?
If you want to spit back a text file, why are you setting it up for uploading the file instead of downloading ? Actually all you're doing is spitting back the name of the file that the user is trying to upload. My version of your script with no real logic changes and some comments : #!/usr/bin/perl use strict; use warnings; use CGI qw/:standard/; use CGI::Carp qw(carpout fatalsToBrowser); print header; print start_html; if (param ('textAreadomains')) { print h1 'Hi - got your domains:', p ( param ('textAreadomains'), ), } elsif (param ('fileDomains')) { # if you want to upload a file here and store it on the disk # you would do that here # if you want to download a file to the user, you could just open # the file here and print it back to the user (you may want to # restrict which file by removing the path and only allowing the # filename and using a specific dir). # right now, you're just printing the name print h1 'Hi - got your filename:', p ( param ('fileDomains'), ), } else { print h1 ('Hi - pick one to input'), start_form, p ("Enter domain names, one per line: ", textarea (-name, 'textAreadomains', -rows, "15", -cols, "75"), ), submit, end_form, hr, start_multipart_form, p ("Or upload a text file: ", filefield (-name, 'fileDomains'), ), submit, end_form, hr; } print end_html; __END__ _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs