I create an input
for file upload by angular-file-upload -
<input type="file" nv-file-select="" uploader="uploader" multiple />
I upload a sample json file -
{
name: "Alice"
}
and I want to see its content on the onAfterAddingFile
event -
onAfterAddingFile function(item) {: Fires after adding a single file to the queue.
uploader.onAfterAddingFile = function (fileItem) {
console.info('onAfterAddingFile', fileItem.formData); // fileItem.formData is []
}
but the fileItem.formData
just contain - []
How could I get the content of the uploaded file ?
onAfterAddingFile
- fires after adding file into upload queue. The file itself isn't uploaded yet, so you can't reach any content, just meta information. Moreover, as far as I understand, formData {Array}: Data to be sent along with this file
means that this is complementary data to send, not file data.