fix: Fixed error when trying to upload file
This commit is contained in:
@@ -357,12 +357,17 @@ export class FilesController extends AbstractViewController<FilesControllerEvent
|
|||||||
try {
|
try {
|
||||||
const minimumChunkSize = this.application.files.minimumChunkSize()
|
const minimumChunkSize = this.application.files.minimumChunkSize()
|
||||||
|
|
||||||
if (fileOrHandle instanceof FileSystemFileHandle && !this.shouldUseStreamingReader) {
|
const fileToUpload =
|
||||||
|
fileOrHandle instanceof File
|
||||||
|
? fileOrHandle
|
||||||
|
: fileOrHandle instanceof FileSystemFileHandle && this.shouldUseStreamingReader
|
||||||
|
? await fileOrHandle.getFile()
|
||||||
|
: undefined
|
||||||
|
|
||||||
|
if (!fileToUpload) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileToUpload = fileOrHandle instanceof File ? fileOrHandle : await fileOrHandle.getFile()
|
|
||||||
|
|
||||||
if (this.alertIfFileExceedsSizeLimit(fileToUpload)) {
|
if (this.alertIfFileExceedsSizeLimit(fileToUpload)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user