Fixed encoding problems when downloading displaying/ downloading files with special characters
This commit is contained in:
parent
2ed68c4fe7
commit
a237fba482
@ -24,7 +24,7 @@ class CacheableFile {
|
||||
CacheableFile.fromDavFile(WebDavFile file) {
|
||||
path = file.path;
|
||||
isDirectory = file.isDirectory;
|
||||
name = file.name;
|
||||
name = file.isDirectory ? file.name : file.path.split("/").last;
|
||||
mimeType = file.mimeType;
|
||||
size = file.size;
|
||||
eTag = file.etag;
|
||||
|
@ -24,6 +24,9 @@ class FileElement extends StatefulWidget {
|
||||
|
||||
static Future<DownloaderCore> download(BuildContext context, String remotePath, String name, Function(double) onProgress, Function(OpenResult) onDone) async {
|
||||
Directory paths = await getTemporaryDirectory();
|
||||
|
||||
var encodedPath = Uri.encodeComponent(remotePath);
|
||||
encodedPath = encodedPath.replaceAll("%2F", "/");
|
||||
|
||||
String local = paths.path + Platform.pathSeparator + name;
|
||||
|
||||
@ -46,7 +49,7 @@ class FileElement extends StatefulWidget {
|
||||
);
|
||||
|
||||
return await Flowder.download(
|
||||
"${await WebdavApi.webdavConnectString}$remotePath",
|
||||
"${await WebdavApi.webdavConnectString}$encodedPath",
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user