How to Create a field in the UiForm in admin panel in which the csv file can be uploaded and read on the submit to store its fields in database in magento2?

  • anyone can help?
    – Ankita
    Commented Dec 30, 2020 at 6:03
  • What do you mean by "Admin panel" is that a custom form or a system config? Commented Dec 30, 2020 at 7:53
  • custom form in admin panel the form link is magento.stackexchange.com/questions/200022/…) now i want add the one more field for taking csv file as a input in this code
    – Ankita
    Commented Dec 30, 2020 at 7:57

1 Answer 1


You should be able to use the: "FileUploader component"(https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-fileuploader.html)

In the path="path/to/controller", he will fire an event once you've chosen your file, my suggestion is to upload the file initially in a specific folder, and then on the submit, check for the file existence and reading it doing your logic.(All of this if that's a ui-component form )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.