Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

formdata array of objects

function createFormData(formData, key, data) {
    if (data === Object(data) || Array.isArray(data)) {
        for (var i in data) {
            createFormData(formData, key + '[' + i + ']', data[i]);
        }
    } else {
        formData.append(key, data);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #formdata #array #objects
ADD COMMENT
Topic
Name
5+7 =