From 4764af730078e1c6b0ac4771e180e327ead305ad Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 26 Apr 2020 08:55:43 +0200 Subject: [PATCH] Correct file download --- lib/utils/matrix_file_extension.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/utils/matrix_file_extension.dart b/lib/utils/matrix_file_extension.dart index 21db7785..cdd80b0f 100644 --- a/lib/utils/matrix_file_extension.dart +++ b/lib/utils/matrix_file_extension.dart @@ -31,7 +31,11 @@ extension MatrixFileExtension on MatrixFile { file.writeAsBytesSync(bytes); await OpenFile.open(file.path); } else if (Platform.isLinux) { - final filePath = "/home/krille/Downloads/"; + final directory = Directory('Downloads'); + if (await directory.exists() == false) { + await directory.create(); + } + final filePath = "${directory.path}/"; final file = File(filePath + path.split("/").last); file.writeAsBytesSync(bytes); System.invoke('xdg-open $filePath');