this working
TypeScript
File ff = File("path/vid.mp4");
await ff.writeAsBytes(bytes);
// Upload file to Storage
final fileUpload = await _storage.createFile(
bucketId: _storageFileBucketId,
fileId: ID.unique(),
file: InputFile.fromPath(
path: ff.path,
filename: file.name,
),
);
- but when i upload from bytes final fileUpload = await _storage.createFile( bucketId: _storageFileBucketId, fileId: ID.unique(), file: InputFile.fromBytes( bytes: bytes, filename: file.name, ), );
it's uploaded file but file not working (it's no same byte size) Byte Size: 31539436
when uploaded _storage.getFileDownload(bucketId: _storageFileBucketId, fileId: fileUpload.$id).then((ss) { print("Size: ${ss.length}"); // Size: 31539429 });
TL;DR
Issue: Uploading a file from bytes results in a file with a different byte size than the original.
Solution: When uploading a file from bytes, ensure the byte size remains the same by checking and adjusting the process accordingly.Recommended threads
- User ID case sensitivity
I see that through REST (and SDK as well), getting a user is not case sensitive. And even though documentation does not clearly state that it is, the wording "V...
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- How to use Sites on selfhosted appwrite
whenever I try to create a site even with template it says 404 nginx error