File handling for file downloads during testing