onSelect supplies you with the selected file from whatever integration you were interacting with as an argument to the callback you define. The type for the argument says that it is a native JS File type, but this doesn't match what is actually returned. The object that came back doesn't sufficiently overlap with the native File type.
Steps to reproduce:
- Authenticate with Google Drive from the file picker
- Select a file
console.log() what is being passed to the onSelect function
onSelect: (file) => {
console.log(file)
}
Example of what object I'm receiving:
{
"id": "-redacted-",
"type": "file",
"mime_type": "-redacted-",
"name": "-redacted-",
"size": 0,
"downloadable": true,
"owner": {
"id": "-redacted-",
"email": "-redacted-",
"name": "-redacted-"
},
"parent_folders": [
{
"id": "-redacted-"
}
],
"parent_folders_complete": false,
"permissions": {
"download": true
},
"exportable": false,
"export_formats": [],
"created_at": "2023-11-27T16:30:03.266Z",
"created_by": "01702477334330046076",
"updated_at": "2023-11-27T16:30:03.266Z",
"updated_by": "01702477334330046076"
}
Example of JS File type:
{
"lastModified": 0
"name": "-redacted-"
"size": 0
"type": "-redacted-"
"webkitRelativePath": "-redacted-"
}
onSelectsupplies you with the selected file from whatever integration you were interacting with as an argument to the callback you define. The type for the argument says that it is a native JSFiletype, but this doesn't match what is actually returned. The object that came back doesn't sufficiently overlap with the nativeFiletype.Steps to reproduce:
console.log()what is being passed to theonSelectfunctionExample of what object I'm receiving:
{ "id": "-redacted-", "type": "file", "mime_type": "-redacted-", "name": "-redacted-", "size": 0, "downloadable": true, "owner": { "id": "-redacted-", "email": "-redacted-", "name": "-redacted-" }, "parent_folders": [ { "id": "-redacted-" } ], "parent_folders_complete": false, "permissions": { "download": true }, "exportable": false, "export_formats": [], "created_at": "2023-11-27T16:30:03.266Z", "created_by": "01702477334330046076", "updated_at": "2023-11-27T16:30:03.266Z", "updated_by": "01702477334330046076" }Example of JS
Filetype:{ "lastModified": 0 "name": "-redacted-" "size": 0 "type": "-redacted-" "webkitRelativePath": "-redacted-" }