Correct file download

This commit is contained in:
Christian Pauly 2020-04-26 08:55:43 +02:00
parent f51123150d
commit 4764af7300

View File

@ -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');