You should be able to do that with one ethernet interface using two sockets. This is a ftp client sketch that uses two sockets on one ethernet shield.http://arduino.cc/forum/index.php/topic,93502.msg707104.html#msg707104You should be able to do that with a web server/client combination, rather than command and data ports (sockets).
The Arduino will not be flexible and probably also not fast enough to do so.
You should get a web server running, then a web client. The ethernet examples in the IDE should help you with each of those. Then combine them. But I would be familiar with the workings of each before attempting the combination.