The first thing I can think of is about using APIs from also popular hosting services like Dropbox.
If you look at the documents it’s pretty easy to upload, list and delete files. I’m pretty sure you can do the same with other dozens of similar services.
The WP API will do the REST (LOL)... Read more here.
I've experienced such issue many times and solved by increasing memory_limit = 256M in php.ini OR adding define( 'WP_MEMORY_LIMIT', '256M' ); in wp-config.php file (*If needed you can increase memory more than 256M) most of the time.
Another possible solution could be giving permission to \wp-content\uploads\ folder; command: chmod -R 0755 wp-content\...