So, it’s pretty simple on an imp, especially if you’re used to server side programming.
The agent (runs cloud side) can issue an HTTP(S) fetch for any accessible resource. The agent only runs with 1MB of memory though, so to fetch large resources you would use HTTP range headers to chunk the data. Once you have a chunk in the agent, you can then send this (with device.send) down to the device, which can then store it.
Again, the device is memory limited (anywhere from ~85kB on imp001 to ~1.2MB on imp005) so you may need to split it into bite sized pieces - I usually do this ~8kB at a time - on the agent side.
Actually… I’ve been meaning to write this example for a while. Here’s some code which will stream an A-Law encoded WAV directly to an imp (1/2/3/4) from a website: https://gist.github.com/hfiennes/3a945b97fadbae72b59ecd763d74864a
… it plays the 7:56 song “Anzeal” by “Strange Angel” which was one of the free MP3s posted on mp3.com back in 1999.
Not exactly what you were looking for, but you can see how you can fetch & chunk files down to the device.