Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
JS file upload.
var form = $('#attach-local-doc-form');
* Note that variable `data` will not show anything due to hidden properties.
* It's purpose is to be passed to the server for parsing.
var data = new FormData(form.get(0));
var fileNames = documentData.getAll("userfile").map(function (file) {
* Now, type this in the console:
* Array.from(data.entries())
* This will list the data object of each file.
<form id="attach-local-doc-form" enctype="multipart/form-data">
<input type="file" multiple name="userfile">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment