#[SOLVED] getFilePreview() doesn't work with react-native
22 messages · Page 1 of 1 (latest)
@untold nacelle can you explain how are we suppose to use this?
The release suggest that it does not returns url but download. What if we just want to view it not download it. What is the new method to do this the old way?
Well, i tried :
const fileUrl = await storage.getFilePreviewURL(appwriteConfig.storageId, fileId, 2000, 2000, 'top', 100);
console.log('Uploaded file URL: ' + fileUrl);
// OUTPUT -> https://nyc.cloud.appwrite.io/v1/storage/buckets/<<storage_ID>>/files/<<file_id>>/preview
But the url doesnt seem to work, when i open the url on a browser (Opera GX) i get this :
{"message":"Storage bucket with the requested ID could not be found.","code":404,"type":"storage_bucket_not_found","version":"1.7.4"}
Are the ids in the link matching your storage bucket?
the storage bucket is the storage id i get in the appwrite website?
Yes
Yes it is the same
Weird.
Well
They will look into it if any of the core members see this
Okay, Thanks a lot
The URL based methods were added, so in this case getFilePreviewURL() should work
Should not be happening... 🤔
can you try removing nyc from the URL and see if that works 👀
Are you Free tier? If so, I also encountered this issue and this feature or some sort is similar to editing which is on Pro Tiers
So just used getfileViewUrl instead
We have a deployment error
Let me get this right.
getFilePreview and getFilePreviewUrl are now separate things?
It doesn't work
no Im Pro tier
Would you please upgrade to 0.10.1 of the react native Appwrite sdk
Yess, it works. Thank you.