-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Description
👟 Reproduction steps
InputFile fileToInputFile(String uri, String path) {
final inputFile = InputFile.fromPath(path: uri, filename: path);
return inputFile;
}
Future<String> uploadMediaToAppWrite(String bucketID, String uri, String path) async{
String loadedUri = '';
final appWriteStorage = Storage(updateAppWriteClient());
String uniqueID = Uuid().v4();
print('$uniqueID is uniqueid');
await appWriteStorage.createFile(
bucketId: bucketID,
fileId: uniqueID,
file: fileToInputFile(uri, path)
).then((response) async{
loadedUri = 'https://cloud.appwrite.io/v1/storage/buckets/$bucketID/files/$uniqueID/view?project=$appWriteUserID&mode=admin';
})
.catchError((error) {
print('error');
print(error.response);
});
return loadedUri;
}
i used this function for uploading both images and videos. with images it succeeded but not with videos.
👍 Expected behavior
I believe just like when uploading image, uploading videos should have been successful because in the client i'm using the same function as the one i used to upload images.
👎 Actual Behavior
but it didnt. it returned an error with the message: '{message: Document with the requested ID already exists., code: 409, type: document_already_exists, version: 0.10.30}'. the only difference between the images and videos in the storage was that i used a separate bucket, and i had double checked the bucket ids. even i tried uploading the video to the image's bucket, but still to no avail.
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Windows
🧱 Your Environment
i am using the 9.0.0. i tried downgrading to 8.1.0 but still everything doesnt change.
👀 Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct