Skip to content

Using PathNameForDownloadedFile: Android suffixes filename by '-1' if file already exists #69

@BtrJay

Description

@BtrJay

Hi @SimonSimCity ,

I've found an issue that when I set PathNameForDownloadedFile for Android before calling

             downloadManager.PathNameForDownloadedFile = downloadFile => filePath; 

i.e. /storage/emulated/0/Android/data/com.builttoroam.podcast/files/Download/a2da6a8b-2b67-44ba-8478-2661/Audio.mp3

            var file = downloadManager.CreateDownloadFile(url);
            file.PropertyChanged += OnFilePropertyChanged;
            downloadManager.Start(file);
            
            // After this line, Android will create Audio.mp3 (empty) and Audio-1.mp3 (actual content is 
            written here)

Have you ever seen this issue before?

I've got this file path from PCLStorage plugin and seems working with iOS && UWP fine.

Just Android is where this issue has been come from.

Kind Regards,

Jay

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions