Upload Multiple Attachments?

ironlion37 03 Oct, 2011
Hi,

My form is successfully uploading one attachment and I'm trying to give the user the option to add three more attachments.

Here is the html (the first block is the one that is working):
<div class="ccms_form_element cfdiv_file" id="upload_spreadsheet_container_div"><label>Upload Spreadsheet</label><input class="" title="" type="file" name="upload_attorneys" />
<div class="clear"></div><div id="error-message-upload_attorneys"></div></div>

<div class="ccms_form_element cfdiv_file" id="upload_document_container_div"><label>Upload Document</label><input class="" title="" type="file" name="upload_doctwo" />
<div class="clear"></div><div id="error-message-upload_doctwo"></div></div>

<div class="ccms_form_element cfdiv_file" id="upload_document_container_div"><label>Upload Document</label><input class="" title="" type="file" name="upload_docthree" />
<div class="clear"></div><div id="error-message-upload_docthree"></div></div>

<div class="ccms_form_element cfdiv_file" id="upload_document_container_div"><label>Upload Document</label><input class="" title="" type="file" name="upload_docfour" />
<div class="clear"></div><div id="error-message-upload_docfour"></div></div>


And here is my event config string:
upload_attorneys:xlsx-xls,upload_doctwo:xlsx-xls-doc-docx-pdf,upload_docthree:xlsx-xls-doc-docx-pdf,upload_docfour:xlsx-xls-doc-docx-pdf,

I haven't configured the Upload Files > OnFail Event Loop in any way.

Thanks in advance.
GreyHead 04 Oct, 2011
Hi ironlion37 »,

Please try removing the , from the end of the Event string. It probably makes ChronoForms think tht there should be one more upload input.

Bob
ironlion37 04 Oct, 2011
Hi Greyhead,

Tried that - no change.
GreyHead 05 Oct, 2011
Hi ironlion37,

Everything else looks OK to me :-(

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob
Max_admin 05 Oct, 2011
Hi ironlion37,

Try to add a "debugger" action after the "upload fields" one and see what it reports ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 09 Oct, 2011
Hi ironlion37,

There's a mismatch between the File upload elements in the form Preview and the Files list in the Upload Files configuration dialogue. The records_request form has one element and four files listed; the record_request_Copy form has two elements and only one file listed.

Hopefully getting this matched up will fix the problem.


Bob
ironlion37 10 Oct, 2011
Hi Bob, this gets to the heart of something I'm not clear on in v4.

I see that there is only one element in the form preview; however, not using the wizard (just clicking on the form title and going to the "Code" tab), I entered this code into the form:


**This is the one that is working and which shows up in the wizard form preview:**
<div class="ccms_form_element cfdiv_file" id="upload_spreadsheet_container_div"><label>Upload Spreadsheet</label><input class="" title="" type="file" name="upload_attorneys" />
<div class="clear"></div><div id="error-message-upload_attorneys"></div></div>

**These are the ones which I added by hand in the "code" tab:**

{showhide title="Click here add more attachments »"}
<div class="ccms_form_element cfdiv_file" id="upload_document_container_div"><label>Upload Document</label><input class="" title="" type="file" name="upload_doctwo" />
<div class="clear"></div><div id="error-message-upload_doctwo"></div></div>

<div class="ccms_form_element cfdiv_file" id="upload_document_container_div"><label>Upload Document</label><input class="" title="" type="file" name="upload_docthree" />
<div class="clear"></div><div id="error-message-upload_docthree"></div></div>

<div class="ccms_form_element cfdiv_file" id="upload_document_container_div"><label>Upload Document</label><input class="" title="" type="file" name="upload_docfour" />
<div class="clear"></div><div id="error-message-upload_docfour"></div></div>
{/showhide}


Are you saying that adding them by hand won't work? If so, that's a big deal because I started with the wizard but left it behind several iterations ago.

Thanks.
GreyHead 10 Oct, 2011
Hi ironlion37,

Adding them like that shouldn't usually cause any problem. I didn't hunt around for hidden inputs. Do they actually display in the form though? You may need to set the Form type to Custom in the Form Code tab. I'm curious why they aren’t being picked up with the upload.

There's another hybrid approach which is to use the Wizard for the standard inputs and put code like this into Custom elements.

Bob
ironlion37 14 Oct, 2011
Hi Bob,

The fields do display in the form. They can be found just above the "Types of Records" section on this page:

http://www.kimtindallandassociates.com/request

As I've stated, "Upload Spreadsheet" does work, but the three after it do not. Is there some kind of limitation on attaching more than one document?

I tried switching the code type to "custom" and it didn't work.

Your help is much appreciated.
GreyHead 15 Oct, 2011
Hi ironlion37.

I just took another look and the uploads (at least the first three) appear to be working OK. The debugger reports sucess and I can see the files on the server.

Upload routine started for file upload by : upload_attorneys
/home/xxx/kimtindallandassociates.com/components/com_chronoforms/uploads/records_request/20111015051708_test_spreadsheet.xlsx has been uploaded OK.
Upload routine started for file upload by : upload_doctwo
/home/xxx/kimtindallandassociates.com/components/com_chronoforms/uploads/records_request/20111015051708_test_doc.doc has been uploaded OK.
Upload routine started for file upload by : upload_docthree
/home/xxx/kimtindallandassociates.com/components/com_chronoforms/uploads/records_request/20111015051708_test_doc.pdf has been uploaded OK.



Bob
ironlion37 17 Oct, 2011
Thank you for verifying that. Any thoughts on why only the first file is being sent with the emails? I'm afraid this has gotten over my head...
GreyHead 17 Oct, 2011
Hi ironlion37,

I think because only the first one is included in the 'Attachments Field Names' box in the Email configuration.

Bob
ironlion37 17 Oct, 2011
Thanks Bob. Not feeling too bright right now. Lot of moving pieces I guess... 🙂

I have one last question that I'd like your thoughts on:

In the form, I give the user the option to CC up to four email addresses. I do this by providing fields in the form and then placing the field names into the "dynamic" tab in an email event. This works great; however, if none of the four email addresses are entered, the form is submitted, but then an error message is shown on the confirmation screen:

"You must provide at least one recipient e-mail address."

Even though their form has submitted successfully, this is confusing to the user and is happening because the email event isn't getting an email address dynamically from one of the four blank fields. My understanding is that if I were to put a dummy email address in the "static" tab, it would prevent the dynamic fields from working. So how can I avoid throwing the (irrelevant) error?

I should mentioned that if they choose to CC someone by entering an email address, this is a non issue.
This topic is locked and no more replies can be posted.