Closed chunlinyao closed 2 years ago
Thank you, this will be very helpful
I assume you are saying q-file. I tested it with uploading Example Contect and got failure. The error is : "Could not find matching constructor for: org.apache.commons.fileupload.FileItem(ArrayList)"
I assume you are saying q-file. I tested it with uploading Example Contect and got failure. The error is : "Could not find matching constructor for: org.apache.commons.fileupload.FileItem(ArrayList)"
Can you share your form definition and service definition.
I just added multiple="true" to contentFile field in the UploadExampleContent form in EditExampleContent.xml as following.
<form-single name="UploadExampleContent" transition="uploadExampleContent">
<field name="exampleId"><default-field><hidden/></default-field></field>
<field name="contentFile"><default-field><file multiple="true"/></default-field></field>
<field name="purposeEnumId"><default-field title="Purpose">
<drop-down><entity-options><entity-find entity-name="moqui.basic.Enumeration">
<econdition field-name="enumTypeId" value="ExampleContentPurpose"/>
<order-by field-name="description"/>
</entity-find></entity-options></drop-down>
</default-field></field>
<field name="locale"><default-field><text-line size="6"/></default-field></field>
<field name="submitButton"><default-field title="Add"><submit confirmation="Really Add?"/></default-field></field>
</form-single>
When add multiple="true", the service parameter type should change to list or object.
Wei Zhang @.***> 于 2022年7月16日周六 下午4:02写道:
I just added multiple="true" to contentFile field in the UploadExampleContent form in EditExampleContent.xml as following.
<form-single name="UploadExampleContent" transition="uploadExampleContent"> <field name="exampleId"><default-field><hidden/></default-field></field> <field name="contentFile"><default-field><file multiple="true"/></default-field></field> <field name="purposeEnumId"><default-field title="Purpose"> <drop-down><entity-options><entity-find entity-name="moqui.basic.Enumeration"> <econdition field-name="enumTypeId" value="ExampleContentPurpose"/> <order-by field-name="description"/> </entity-find></entity-options></drop-down> </default-field></field> <field name="locale"><default-field><text-line size="6"/></default-field></field> <field name="submitButton"><default-field title="Add"><submit confirmation="Really Add?"/></default-field></field> </form-single>
— Reply to this email directly, view it on GitHub https://github.com/moqui/moqui-runtime/pull/199#issuecomment-1186113885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEJN7LLEIXCIQMPPYMYMDVUJUDBANCNFSM53VIFV2Q . You are receiving this because you authored the thread.Message ID: @.***>
Thanks for clarification!
When use
q-input
withmultiple
enabled,formData.set
will comnvertFile
array toString
array. This PR fixed the bug, make multiple file upload work.