chore: Check file size before loading
This commit is contained in:
parent
b6808535ab
commit
63d5d6e61f
1 changed files with 3 additions and 0 deletions
|
|
@ -66,6 +66,9 @@ class SendFileDialogState extends State<SendFileDialog> {
|
||||||
scaffoldMessenger.showLoadingSnackBar(l10n.generatingVideoThumbnail);
|
scaffoldMessenger.showLoadingSnackBar(l10n.generatingVideoThumbnail);
|
||||||
thumbnail = await xfile.getVideoThumbnail();
|
thumbnail = await xfile.getVideoThumbnail();
|
||||||
} else {
|
} else {
|
||||||
|
if (length > maxUploadSize) {
|
||||||
|
throw FileTooBigMatrixException(length, maxUploadSize);
|
||||||
|
}
|
||||||
// Else we just create a MatrixFile
|
// Else we just create a MatrixFile
|
||||||
file = MatrixFile(
|
file = MatrixFile(
|
||||||
bytes: await xfile.readAsBytes(),
|
bytes: await xfile.readAsBytes(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue