vaadin / vaadin-upload

The Web Component for uploading multiple files with progress indication. Part of the Vaadin components.
https://vaadin.com/components
Apache License 2.0
90 stars 63 forks source link

File name not present in the serialized 'upload-success|error|abort' events #269

Closed TomiZet closed 6 years ago

TomiZet commented 6 years ago

Events 'upload-success', 'upload-error' and 'upload-abort' handled by vaadin-upload component are serialized and send to the back-end (BE). But the event.detail.file does not contain name property. Thus the BE has no information about which file upload was aborted. For more details see also vaadin/components gitter, message from 07th June 2018, Question#1

limonte commented 6 years ago

File objects aren't serializable by default: http://jsbin.com/nuwivexeto/edit?html,js,console,output

I'm not sure which BE you're using and how your FE communicating with the BE, but maybe this workaround will work for your case: https://stackoverflow.com/a/29281243/1331425

TomiZet commented 6 years ago

Thanks for the reply! By BE I mean vaadin-flow server part of this UI component.. so the problem is not in the component itself, but in the event listeners, which are I guess registered by vaadin-client js library, correct? When debugging this problem I ended up in the obfuscated js code in the VAADIN/static/client and there the file object was serialized and send to the BE. If so, then this issue might be closed and I need to address it for the client library - same would apply also for issue #270.

limonte commented 6 years ago

Alright, I'll close this issue and #270 for now. Feel free to add comments in future on both issues so we can reopen them and fix issues if there are some.