My webform uses both multifile component and original webform file component. Having more than one single file component and trying to upload a file into it beyond the first component generates an error from multifile.

To recreate the issue:
1. Create webform
2. Add two webform file components
3. Add one multifile component.
4. Display the form
5. Choose one file in either of the file component fields
6. Click upload. File gets uploaded to proper location on server.
7. Choose one file in the other file component field
8. Click upload. Form gets posted. Server returns 500 to the POST. Error log has the following errors:

- Warning :strrpos() expects parameter 1 to be string, array given in _webform_validate_multifile() (line 503 of [...]/sites/all/modules/webform_multifile/multifile.inc).
- Notice :Array to string conversion in drupal_substr() (line 518 of [...]/includes/unicode.inc).

Related issue:
#289919: Provide AJAX-based file uploads/Progress Bar for uploads

Comments

Akshita’s picture

@shadysamir - Hi

Even I am having the same issue .After updating the webform and webform-multifile modules the field with 'file' option is no more working.

With the field with option 'multifile' -

Case 1: If I upload only one file then that file is saved onto the location (sites/default/files/webform) and the link to the uploaded file is sent in the email.

Case 2 : when uploaded (on 'multifile' field) more than 1 then those files are not saved on to the location (sites/default/files/webform)as a result no links are sent in the email.

Is case 2 working for you ?

Here is my thread : http://drupal.org/node/1512354

Please respond

Thanks in advance

attiks’s picture

Assigned: Unassigned » Jelle_S

@shadysamir thanks for the clear instructions, there's a problem when you combine regular files with multi file on the same webform, if you have time can you try the following and let me know if it works:

  1. webform with only multi file component
  2. webform with only regular file component

cheers

attiks’s picture

Problem is caused by the AJAX calls, if you don't click the upload button of the regular file field it should work.

shadysamir’s picture

I will test your requests from #2. Meanwhile I did try without using the ajax upload already. It does work. But unfortunately I cant put instructions for users not to click the upload button.

attiks’s picture

Status: Active » Fixed

@shadysamir, no need to test anymore, it should be fixed in the latest dev version. Wait another 12 hours or use git to get the code.

shadysamir’s picture

Sweet :) Works great. Thanks

Akshita’s picture

@shadysamir - Hi

Are you able to upload mutiple files with the field 'multifile' ?

I could able to upload multiple files but they are not saved onto the location "sites/default/files/webform" as a result there are no links sent in the email.

According to Attiks & Jelle - It is working fine at their end.

Please let me know whether it works at your end - If it works then I have to check my module list and see what causing the issue.

shadysamir’s picture

@Akshita

I think you are addressing a different issue. But the answer for your question is yes, I am able to upload files with multifile fields.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.