- SDK Version: 4.0.17
- Platforms(Android/iOS/web/all): IOS 14.4
Hello everyone,
I’m using the following code to get my video, and upload it to S3.
And the uploading kinda of works, but it only uploads/finds like 200kb(1 frame basically) of the video ,that is way bigger than that.
Originally i have this Object, which contains the "“assets-library:” url for the file.
Then i go and copy from this path to my cached directory, and from this point on we can access the files information.
let newId = makeid(10) + "." + uploadItem.filename.split('.').pop();;
const path = FileSystem.cacheDirectory + newId
await FileSystem.copyAsync({
from: uploadItem.uri,
to: path
}).then(() => {
console.log("File has been copied")
}).catch((err) => {
console.log("error", err)
})
let file = await FileSystem.getInfoAsync(path, { md5: true, size: true });
if (file) {
console.log(file.uri)
}
From this i get the following result:
Object {
"exists": true,
"isDirectory": false,
"md5": "fb625b55365479e8e6fcab6d74b0160f",
"modificationTime": 1612486372.300014,
"size": 206711,
"uri": "file:///var/mobile/Containers/Data/Application/69397E6D-5F90-4B8B-A378-ADF7D755D034/Library/Caches/ExponentExperienceData/%2540anonymous%252Fbibbu-30d91604-3fd6-4f5b-9efd-eebae9bc85e1/XVTYW6LIVT.MP4",
}
The file is way smaller then if i upload directly to S3, so i dont understand what’s wrong, or what i might be doing wrong.
I would appreciate all the help i can get!
Best regards Daniel