File uploading is fairly painless with CGI.pm
. From the manpage:
CREATING A FILE UPLOAD FIELD
print $query->filefield('uploaded_file','starting value',50
When the form is processed, you can retrieve the entered
filename by calling param():
$filename = $query->param('uploaded_file');
You can then copy the file to the appropriate place
(perhaps using the File::Copy
core module), and
then use the chmod
operator to make it executable.
An important security concern is to make sure your
script is not available to the general populus, because you've
effectively given an open prompt to whomever wants it.