View Full Version : Perl CGI: HTML Submit to CGI Script to Copy File
jamesmkennedy
10-21-2008, 09:13 PM
I need a very simple Perl CGI script that will copy FileA to FileC in Unix, when I click a submit button from a web page. Basically, I have a file that's named, let's say, "StandardFile", on a Unix server, in the CGI bin, along with two other files named, let's say, "FileA" and "FileB". On a web page I will have two buttons: one that, when clicked, will run a Perl script that copies and replaces FileA to StandardFile; the other, when clicked, will run a second Perl script that copies and replaces FileB to StandardFile. In other words, every time I click either of the buttons it will make the StandardFile either FileA or FileB appropriately. I hope that makes sense. I'm basically a cut-and-paste kind of programmer, so if someone could guide me into how to make this very simple, that would be great. This is a temporary quick-fix solution for when I will be on vacation. Thanks in advance!
oesxyl
10-22-2008, 11:59 AM
I need a very simple Perl CGI script that will copy FileA to FileC in Unix, when I click a submit button from a web page. Basically, I have a file that's named, let's say, "StandardFile", on a Unix server, in the CGI bin, along with two other files named, let's say, "FileA" and "FileB". On a web page I will have two buttons: one that, when clicked, will run a Perl script that copies and replaces FileA to StandardFile; the other, when clicked, will run a second Perl script that copies and replaces FileB to StandardFile. In other words, every time I click either of the buttons it will make the StandardFile either FileA or FileB appropriately. I hope that makes sense. I'm basically a cut-and-paste kind of programmer, so if someone could guide me into how to make this very simple, that would be great. This is a temporary quick-fix solution for when I will be on vacation. Thanks in advance!
try man pages for file::copy and cgi.
regards
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.