lakeTrout has asked for the wisdom of the Perl Monks concerning the following question:
Update: When I say build another CGI, what I am eventually doing is operations on the uploaded file based on a few simple inputs from the second form. Hope that will clarify things some.#!/usr/bin/perl -w use CGI; use CGI::Carp qw(fatalsToBrowser); $upload_dir = "/foo/bar/upload"; $query = new CGI; $filename = $query->param("somexmlfile"); #pass_word = $query->param("password"); will add later $filename =~ s/.*[\/\\](.*)/$1/; $upload_filehandle = $query->upload("somexmlfile"); #cp here, probably will be mv exec "cp ../foo/bar/existing.xml existing.xml.BAK"; open UPLOADFILE, ">$upload_dir/$filename"; binmode UPLOADFILE; while(<$upload_filehandle>){ print UPLOADFILE; } close UPLOADFILE; print $query->header ( ); print <<END_HTML <html> <h2>File Received</h2> ###################################### #Can I build another HTML/CGI from from here? ###################################### </html> END_HTML
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple forms in one CGI file?
by davorg (Chancellor) on Jan 30, 2007 at 09:29 UTC | |
by blazar (Canon) on Jan 30, 2007 at 15:46 UTC | |
by EvanK (Chaplain) on Jan 30, 2007 at 16:41 UTC | |
by spatterson (Pilgrim) on Jan 30, 2007 at 13:08 UTC | |
|
Re: Multiple forms in one CGI file?
by jesuashok (Curate) on Jan 30, 2007 at 06:59 UTC | |
by lakeTrout (Scribe) on Jan 30, 2007 at 07:08 UTC | |
by jesuashok (Curate) on Jan 30, 2007 at 07:10 UTC | |
by lakeTrout (Scribe) on Jan 30, 2007 at 07:47 UTC |