I am using the function below to upload a file.
File fileResult = await file.writeAsBytes(byte, mode: FileMode.append);
I test 2 cases by
- Uploaded
1.pngin the empty folder. - Uploaded
1.pngin the folder that already has1.png.
These results are the same!
But case 2 can't upload because this file name already exists and I use the FileMode.append method.
The fileResult.isAbsolute is always false I don't know why.
I can check by using the await file.exists() before uploading or using a unique file name. But I want to know how to check the upload by using _.writeAsBytes() is a success or not.