added flush for FileOutputStream in upload-file