I have created a custom form using Ui_Component,facing problem during image upload. I am using 2 column left layout ie, tab structure.


When I try to upload the image it shows an alert "Attention: File was not uploaded".


The file upload is working fine when I use 1 column layout. Here is the ui component

<field name="image_path">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="source" xsi:type="string">image_path</item>
                    <item name="label" xsi:type="string" translate="true">Image</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="formElement" xsi:type="string">fileUploader</item>
                    <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                    <item name="required" xsi:type="boolean">true</item>
                    <item name="visibleValue" xsi:type="string">image</item>
                    <item name="uploaderConfig" xsi:type="array">
                        <item name="url" xsi:type="url" path="example/example/imageupload"/>

I have found a related bug https://github.com/magento/magento2/issues/15675

Please help me to resolve this

  • Can you please add your xml code for file uploading field ? – Rutvee Sojitra May 15 '19 at 11:48
  • @RutveeSojitra I have added the code – Jancy Abraham May 16 '19 at 3:09
  • <item name="formElement" xsi:type="string">fileUploader</item> change this line with below line <item name="formElement" xsi:type="string">imageUploader</item> and try – Rutvee Sojitra May 16 '19 at 4:26
  • @RutveeSojitra Still the same error – Jancy Abraham May 16 '19 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.