Question: how to transfer files to the icloud?
Answer: From your Mac, choose Apple menu  > System Preferences. Click Apple ID, then click iCloud. ... 
Make sure that iCloud Drive is turned on.
Next to iCloud Drive, click Options.
Choose Desktop & Documents Folders.
Click Done.