
Sorry everyone but I got a problem SERVICE
return this.storage.getFilePreview(
conf.appwriteBucketId,
fileId
)
}```
**Not working in my post form**
``` {post && (
<div className='w-full mb-4'>
<img
src={appwriteService.getFilePreview(post.blogImage)}
alt={post.title}
className='rounded-lg'
/>
</div>
)}```
**Not working in my Home page**
``` <div>
{!blogImage? null: <div>
<img src={appwriteService.getFilePreview(blogImage)} alt={title}/>
</div> }
<div'>
<div>{title}</div>
</div>
</div>```
**Not working in my blog page**(When I visit blog page it says missing parameter 'fileId')
```<img
src={appwriteService.getFilePreview(post.blogImage)}
alt={post.title}
className='rounded-xl'
/>```

This is where I assign fileId
try {
const file = await appwriteService.uploadFile(data.image[0]);
if (file) {
const fileId = file.$id
data.blogImage = fileId
console.log(`blogImage`, fileId)
const dbPost = await appwriteService.createPost({
...data,
userId: userData.$id})
if (dbPost) {
navigate('/profile')
}
}
} catch (error) {
console.log(`ERROR POSTING `, error)
}
}```

Please help

Did you try logging fileId
before passing it into storage.getFilePreview()
?

As with everything, troubleshoot by working your way back, making sure inputs/outputs/variables are what you expect them to be

Yes I did and it shows correct data

But you're getting an error saying fileId is missing?

react-router-dom.js?v=de89454e:3534 React Router caught the following error during render AppwriteException: Missing required parameter: "fileId" at Storage.getFilePreview (http://localhost:5173/node_modules/.vite/deps/appwrite.js?v=de89454e:2929:13) at AppwriteService.getFilePreview (http://localhost:5173/@fs/C:/Users/User/Desktop/bloghub/blogHub/src/backend/config.js?t=1711323347785:151:29) at Blog (http://localhost:5173/@fs/C:/Users/User/Desktop/bloghub/blogHub/src/pages/Blog.jsx?t=1711323347785:56:32) at renderWithHooks (http://localhost:5173/node_modules/.vite/deps/chunk-SHEUFWB5.js?v=de89454e:12171:26) at mountIndeterminateComponent (http://localhost:5173/node_modules/.vite/deps/chunk-SHEUFWB5.js?v=de89454e:14921:21) at beginWork (http://localhost:5173/node_modules/.vite/deps/chunk-SHEUFWB5.js?v=de89454e:15902:22) at beginWork$1 (http://localhost:5173/node_modules/.vite/deps/chunk-SHEUFWB5.js?v=de89454e:19749:22) at performUnitOfWork (http://localhost:5173/node_modules/.vite/deps/chunk-SHEUFWB5.js?v=de89454e:19194:20) at workLoopSync (http://localhost:5173/node_modules/.vite/deps/chunk-SHEUFWB5.js?v=de89454e:19133:13) at renderRootSync (http://localhost:5173/node_modules/.vite/deps/chunk-SHEUFWB5.js?v=de89454e:19112:15) Object

yes

Also, instead of saying something is not working, it's better to be explicit and say what is going on

sure

AppwriteException: Missing required parameter: "fileId"

In my home page I am not getting any error but I cannot preview the image same case with post form page but in my blog page it is showing that AppwriteException: Missing required parameter: "fileId"

Sounds like you have two different problems

yes

Focus on the file id error in this support thread

For your other one, search support for similar problems and 3rd party cookies

sure
Recommended threads
- not getting cookie in header of appwrite...
my website working locally and on vercel , but when hosting on appwrite sites the main core issue is its not getting the cookie . <@743532656767270934> help
- custom domain failing
I have an appwrite app at a subdomain myapp.topdomain.com. I want to configure the appwrite endpoint to use a 2nd level subdomain e.g. api.myapp.topdomain.com. ...
- Getting CORS error for GraphQL query on ...
Getting CORS error when making GraphQL queries using Appwrite's SDK in Next.js (client-side). Login/signup works fine. Only GraphQL is failing on both localhost...
