Gossamer Forum
Home : Products : DBMan : Customization :

multi-upload question

Quote Reply
multi-upload question
I'm uploading multiple files. The first is dedicated to a resume file and the second to a picture. I'm able to differentiate between the files by using their file extension to put them into the correct cell of the record_long output table.

My question relates to the name of the picture as you add them in record_edit.

Here's my code.

if ($form_upload_add) {
print qq|<tr><td colspan=3><center><$font>You may upload a resume and a picture.</center></font>

<TR><TD colspan=3><center><$font>Browse your computer to upload a resume file!

Valid file formats are .wpd, .doc, .pdf, .txt, .htm, or .html</center>
<INPUT TYPE="FILE" NAME="file-to-upload-1" SIZE="44"></TD></TR></font>

<TR><TD colspan=3><center><$font>Browse your computer to upload a picture file!

Valid file formats are .jpg or .gif</center>
<INPUT TYPE="FILE" NAME="file-to-upload-2" SIZE="44"></TD></TR></font>|;

I changed the original record_add routine to this so I can have the files specified as either a resume or picture. Multi upload automatically generates file upload boxes according to the number of files you can upload. Mine is no different. However, when a user puts a file in the second "upload" box rather than the first, it won't upload the file because the Name="file-to-upload-2" is used rather than "file-to-upload-1". Is their any way I can allow the upload of a picture only using the code I listed above? I've tried an IF statement to determine if a file is uploaded and then used "file-to-upload-1", but the problem is that the file is not uploaded yet. If this doesn't make sense then I will try to reword.

Chris Whatley