Added a check for existence of collectionID before trying to upload, and get a file