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
- THE COLUMNS STUCK ON PROCESSING HOW DO I...
I HAVE SELF HOSTED THE APPWRITE ON VPS
- Bug report: Race condition in Flutter SD...
Hi team, I've found an intermittent bug in the Flutter SDK (v20.3.0) when using `createOAuth2Session` on Android. **Symptoms** After `createOAuth2Session` re...
- Impossible to create project via CLI?
Is it possible to create a new project via the appwrite CLI ? I need to create a few projects for something I'm working on and because i don't want to do it man...