Magento 2 Dynamically Add file uploader in system config
-
09-03-2021 - |
Solution
This does not fully answer my question but partially and puts it in the right direction:
I added now file uploader look like so:
Now when I save serialised data looks like this:
{
"_1565251449037_37": {
"category_id": "5",
"file_uploaded": {
"name": "",
"type": "",
"tmp_name": "",
"error": 4,
"size": 0
}
},
"_1565251729340_340": {
"category_id": "7",
"file_uploaded": {
"name": "wed2b_regions_stores_v1.csv",
"type": "text\/csv",
"tmp_name": "\/private\/var\/tmp\/phpZwzFAH",
"error": 0,
"size": 10591
}
}
}
When it return to the page refreshed I am getting the error:
I understand why the error is because the element is a file element button and it can't be set plus I think magento is expecting the "file_uploaded"
to be string and is an object and not a string when perhaps value should be file_uploaded.name
Any help on this appreciated.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange