Need help saving file from URL

Hello, I am trying to do a simple mp3 file download off a webserver. I'm quite new and I need help getting from InputStream to an actual file saved on my hard drive.

URL myUrl (;

InputStream* urlStream = myUrl.createInputStream(true);

<Not sure what to do next>

Saved into -> File(local_path/test.mp3);


Any and all help appreciated! Thanks.

Okay, I think I got it... Here it is in case anyone else is interested or if you think I'm doing it all wrong (which is very possible).


URL fileUrl("");

ScopedPointer<InputStream> fileStream = fileUrl.createInputStream(false);

File localFile("c:/somepath/test.mp3");


MemoryBlock mem(1024);


FileOutputStream out(localFile);

out.write(mem.getData(), mem.getSize());