fixed pending share race error on warm app start
This commit is contained in:
@@ -187,11 +187,23 @@ class _FilesUploadDialogState extends State<FilesUploadDialog> {
|
||||
'${_uploadableFiles.indexOf(file) + 1}/${_uploadableFiles.length}';
|
||||
});
|
||||
|
||||
// A vanished source file would otherwise surface as a cryptic
|
||||
// "Content-Length must contain only digits" HttpException, because
|
||||
// statSync reports size -1 for missing files.
|
||||
final fileStat = FileStat.statSync(filePath);
|
||||
if (fileStat.type == FileSystemEntityType.notFound || fileStat.size < 0) {
|
||||
_showUploadError(
|
||||
'Die Datei "$fileName" ist nicht mehr verfügbar. '
|
||||
'Bitte wähle sie erneut aus.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
final HttpClientResponse uploadTask;
|
||||
try {
|
||||
uploadTask = await webdavClient.putFile(
|
||||
File(filePath),
|
||||
FileStat.statSync(filePath),
|
||||
fileStat,
|
||||
PathUri.parse(fullRemotePath),
|
||||
onProgress: (progress) {
|
||||
setState(() {
|
||||
|
||||
Reference in New Issue
Block a user