khushpanchal / Ketch

An Android File downloader library based on WorkManager with pause and resume support.
https://medium.com/@khush.panchal123/ketch-android-file-downloader-library-7369f7b93bd1
440 stars 33 forks source link

Download Failed issue with fileNames #13

Closed hamza0786 closed 2 months ago

hamza0786 commented 2 months ago

Hi! the download failed when the fileName is these:

"A Personal Story From The Secret Service Exposes The Agency (Ep 2300) - 08/02/2024" "Jacques - "Absolve""

but works fine when fileName is: "Frog 4k HDR 10+ Dolby vision"

can you help in fixing this issue.

as i think the issue is seems to be that the library does not supporting the filenames with some special character and spaces etc.

khushpanchal commented 2 months ago

File name you are sending is invalid, avoid adding special character in fileName.

You can validate filename before sending to library like this:

 fileName.replace("[^a-zA-Z0-9-. ]+".toRegex(), "_")
hamza0786 commented 2 months ago

thanks!