changed the file upload to use streams