Did you request permission to external storage. This is a standard Android app permission.
You will also need to save the file to local app storage or request permission to save in the folder you specified.
Here is a thread that describes some of the requirements when saving files on android 10: