chose appropriate file name extension for downloading a subdocument