I have an upload.htm where the user can choose four photos to upload. I then use a combobox where the user can select from three albums to send photos to, or type in a new album title in the textfield. In my upload.cgi, I am successful in handling the three given albums, but I don't know how to handle the editable textfield. The upload.cgi sends the photos to a photo gallery on my DEV content management system. Here is a portion of the code, where "new" is the value given to the editable textfield. What code would create the new directory in my photo gallery?
#!/usr/bin/perl -w
use CGI::Carp qw(fatalsToBrowser);
use CGI;
$query = new CGI;
$user = $query->param("email_address");
$filename = $query->param("photo1");
$filename =~ s/.*\/\/$1/;
$upload_filehandle = $query->upload("photo1");
if ($user eq "js") {
$upload_dir = "/home/mysite/www/dev/photo_gallery/sun";
}
elsif ($user eq "jj") {
$upload_dir = "/home/mysite/www/dev/photo_gallery/moon";
}
elsif ($user eq "kd") {
$upload_dir = "/home/mysite/www/dev/photo_gallery/stars";
}
elsif ($user eq "new") {
$upload_dir = "/home/mysite/dev/photo_gallery/???????????J";
}
open UPLOADFILE, ">$upload_dir/$filename";
while ( <$upload_filehandle> )
{
print UPLOADFILE;
}
close UPLOADFILE;