

what are permissions on the file and bucket?

file permissions are delete for the owner
bucket permissions are create and read for all users



const bucketId = process.env.EXPO_PUBLIC_BUCKET_ID!;
const renderPost = ({ item }: { item: Post }) => {
const imageUrl = appwrite.getFilePreview(bucketId, item.fileId).toString();
console.log(imageUrl);
return (
<TouchableOpacity
onPress={() => {
router.push({
pathname: '/profileFlatList',
params: { selectedPostId: item.$id },
});
}}
className="w-1/3"
>
<Image
source={{
uri: imageUrl,
headers: { Accept: 'image/*' },
}}
className="h-32"
/>
</TouchableOpacity>
);
};
getFilePreview(bucketId: string, fileId: string): URL {
try {
const previewUrl = this.storage.getFilePreview(bucketId, fileId);
const urlWithParams = new URL(previewUrl.toString());
urlWithParams.searchParams.append('mode', 'admin');
return urlWithParams;
} catch (error) {
console.error('Appwrite service :: getFilePreview() :: ', error);
throw error;
}
}

images not hosted on appwrite are rendering

only the filepreview ones are throwing 404

even with hard-coding the url same issue, appwrite hosted images are giving 404
Recommended threads
- Google sign in wont allow you to choose ...
Hi, this is still unsolved, Appwrite's SDK won't let you specify prompt=select_account param, so a user cannot signin with a desired account, in chrome is just ...
- Console ErrorAppwriteException: User (ro...
AppwriteException: User (role: guests) missing scope (account) at Client.eval (webpack-internal:///(app-pages-browser)/./node_modules/appwrite/dist/esm/sdk....
- AppwriteException: Project ID not found
I'm getting this error: `Error signing up: AppwriteException: Project with the requested ID could not be found. Please check the value of the X-Appwrite-Project...
