Skip to content

Commit 7cf781a

Browse files
author
Jenser Almeida
committed
Update the file name on the notification (#620)
1 parent ab53601 commit 7cf781a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

android/src/main/java/vn/hunghd/flutterdownloader/DownloadWorker.java

+4
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,10 @@ private void downloadFile(Context context, String fileURL, String savedDir, Stri
403403
outputStream = context.getContentResolver().openOutputStream(uri, "w");
404404
} else {
405405
File file = createFileInAppSpecificDir(filename, savedDir);
406+
if (file.getName() != filename) {
407+
filename = file.getName();
408+
taskDao.updateTask(getId().toString(), filename, contentType);
409+
}
406410
savedFilePath = file.getPath();
407411
outputStream = new FileOutputStream(file, false);
408412
}

0 commit comments

Comments
 (0)