iCloud Drive will do that. If you don't have a connection the files will still be accessible on the phone, as iCloud is a syncing service, and all iCloud Drive content is replicated on all devices. When you next have a connection available any updates on the phone will sync back to iCloud and to all other devices logged in to iCloud. On a Windows computer you can either log in to https://icloud.com to see and manage your files, or you can download iCloud for Windows.
If a file is updated on 2 devices while offline you will be told that when you try to open it, and you will have a choice of choosing the version you want to use.
There are also 3rd party options: Dropbox.com, box.com, Google Drive, Microsoft One. All of them are supported on iOS devices.