telling vaadin-upload that a file has 'finished'

Hi,

In the situation I am using vaadin-upload, in the ‘uploadbefore’ callback, I make a call to a server and part of its response tells me that it has already uploaded the file (using my calculated md5sum for the file).

So, instead of uploading the file, which I do by calling uploadFiles([file]
), I want to somehow tell vaadin-upload to indicate that the file upload is complete, so it looked like it uploaded really quickly.

I’ve tried:

    file.progress = 100;
    file.complete = true;
    file.status = '';
    file.uploading = false;
    file.held = false;
    file.loaded = file.size;
    upload.uploadFiles([file]

);

but that seems to put the file into ‘Queued’.

Any idea how to force it into the same state that it looks like it’s finished uploading? Perhaps there’s some other way to indicate this situation?

FWIW, I seem to have some success doing something similar:

        const index = this.$.upload.files.findIndex((file) => file.s3Filename === s3Filename);
        upload.set(`files.${index}.complete`, true);
        upload.set(`files.${index}.held`, false);
        upload.set(`files.${index}.uploading`, false);
        upload.set(`files.${index}.loaded`, file.size);
        upload.set(`files.${index}.status`, '');
        upload.set(`files.${index}.progress`, 100);
        console.info('already uploaded:', file.name);

It’d be nice to know what exactly needs doing, but this is good for now.