Okay, it seems it’s working well and file is being stored in Documents folder, The issue was that toFileName cannot have slash in starting.
These are the current blocks :
Demo Apk -
FileTest (6).apk (4.6 MB)
Note - It seems non media files can only be stored in either Download folder or Documents folder or there will be a IOException.