MaxOriginal post
Rank 1: Thread
this working
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: 31539436when uploaded
_storage.getFileDownload(bucketId: _storageFileBucketId, fileId: fileUpload.$id).then((ss) {
print("Size: ${ss.length}"); // Size: 31539429
});
Summary
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.