Download iCloud and Google drive files to file system

Hello everyone, I want to download files from iCloud and save it to a specific folder in IOS. Same with google drive.
How can this be done?