bergben / ng2-file-input

Angular 2 component that implements a drag and drop or select file selection, including preview.
MIT License
25 stars 11 forks source link

How to access selected file to upload it on server #13

Closed tomNjerry closed 7 years ago

tomNjerry commented 7 years ago

event.currentFiles[i] returns me file object as File { name: "Tanmay Surlekar.JPG", lastModified: 1505560052000, lastModifiedDate: Date 2017-09-16T11:07:32.000Z, webkitRelativePath: "", size: 51264, type: "image/jpeg" }

Now, I want to upload this file one by one to server, or may be the array of files as it is. But, this wont help as on server end I'm just getting blank objects same as the size of currentFiles array. That is, if I select 5 files on client side then I get 5 blank object's array on server.

bergben commented 7 years ago

Hey @tomNjerry,

I am sorry but this doesn't seem to be a ng2-file-input related issue? I don't know what backend you are using but it seems like the files are not being transferred correctly...

Stoffel-KT commented 6 years ago

I actually also don't understand how to put the selected files in an angular form and submit them to the back end...