How to pass file meta data information on uppy.use(Tus,..) extension?

Hi,

Is it possible to pass the meta data information before the select/download file to uppy companion?
// This is demo code that using to download file that selected from drive.


var uppy = new Uppy.Core()
    .use(Uppy.Dashboard, {
        inline: true,
        autoProceed: false,
        onBeforeFileAdded: (currentFile, files) => currentFile, 
        infoTimeout: 5000,
        target: '#drag-drop-area',
    })
    .use(Uppy.Tus, {
        endpoint: 'http://localhost:41944/',
        metaFields: {
            name: file.name || file.id , //<-- get file name that will select from google drive
            contentType: file.type || 'application/octet-stream' // <-- this line 
        }

    })

Getting error on file object is null exception.
How to pass dynamic file metadata information like extension, filename on
Uppy.Tus() parameter…?

The filename and extension are always saved in your Tus server, or in whatever store you used together with Tus. Uploaded file names must be unique however to avoid the problematic outcome of files with the same name, which is what happens if you let users upload whatever they want. Instead, there is a .info file for every file, like this in S3:

If you want to change the file names, you want to do that in onBeforeFileAdded.

If you want to send additional headers with the request, use onBeforeRequest.

Lastly, you’re using metaFields incorrectly, it is used to filter, not to send additional fields.