getFile function

Prepare a file for downloading