In case you don't have wget installed or you need some more control over downloading the file, you should use system sockets and look into HTTP RFC.
This is more complex than just executing external programs, but this knowledge will help you in the future anyway.