

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
- Realtime stuck on pending
I'm hosting appwrite on a server where there's already nginx running and you can see how it's config looks for appwrite on attachted screenshot. I'm not getting...
- Appwrite Cors Errors after domain added
So I'm working on an app for my company and I've added in my domain name as the hostname for the project as well as for the custom domain. But I'm still getti...
- Appwrite custom domain verification fail...
So I've left enough time for the records to propagate and I've tried adding in a subdomain for the appwrite endpoint so as not to cause a clash with two CNAME r...
