How to automate send and download while sending request and uploading same document?

I want to know how can we automate this so that while running collection my request automatically downloads the document to my pc and then i want to upload the same document on next request. Anyone know something about this please help.