I am working on a form upload element that can be used in Zend Framework forms. I am trying to make it possible for a programmer to use it in any project without having to manually configure any settings.
Files are loaded by the AJAX loader, which returns JSON data, for example:
[ { "name":"image.png", "size":42410, "type":"image\/png", "url":"http:\/\/example.com\/image.png", "thumbnail_url":"http:\/\/example.com\/thumbnail\/image.png", } ]
Since the loader itself is an element of the form, I am trying to put this data into the form, so that the values ββcan be obtained from $ _POST on submit. I added hidden input fields with javascript named uploader-data [] (when submitting the form), but this only allows me to pass 1 variable at that time to a hidden field.
So, I think, my question is: "How to pass the entire array / object to the form $ _POST /?". Despite the fact that I use AJAX for the loader itself, I do not want to use it to submit the form. I want a regular form to represent all the data from a JSON object / array. The files themselves are already loaded, but I can use JSON data in my database or elsewhere.
Is it possible to do something like this?
Thanks in advance.
source share