I have a form that I want to upload photos with. I can make it work perfectly with one file, but I want them to be able to add multiple files and when I try that the files get saved but with 0 bytes. (FYI - I am using Mason)
<input type="file" name="file_1">
<input type="file" name="file_2">
<input type="file" name="file_3">
And then to process the submission of the files...
if ($fileList[0]) {
my $uploadCnt = 3;
my $fileCnt = 1;
for (;$fileCnt<=$uploadCnt;$fileCnt++) {
my $upfile = $ARGS{"file_$fileCnt"};
### this passes the file to the mason component I created
+to upload files
my $fileRef = $m->comp("fileUploader.mas",upload_file=>$up
+file);
}
}
Whereas with just one file, I just send the file_1 directly to my uploader, like so:
my $fileRef = $m->comp("fileUploader.mas",upload_file=>$file_1);
When I do a Data::Dumper (print Dumper(\$upfile)) it just has the file name in there. Is there a default folder on the server the files are being stored at temporarily that I can just prepend to that file and move it? I am not sure what is happening and what to do to fix it. Any suggestions?