Add file extension automatically when creating file from stream