Dealing with different File Types when Retrieving files