I'm trying to upload data but it says Property 'store' does not exist on type 'StorageWriter'
How can I upload stuff?
I'm reading this https://docs.convex.dev/file-storage/store-files but the .store does not exists
"convex": "^1.17.2",
Storing Generated Files | Convex Developer Hub
Files can be uploaded to Convex from a client and stored directly, see
9 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
your function is a mutation; you need to store data in storage in an action
the example here is an action: https://docs.convex.dev/file-storage/store-files
Storing Generated Files | Convex Developer Hub
Files can be uploaded to Convex from a client and stored directly, see
the example uses a separate mutation to commit the storage id etc to the database after the blob is uploaded into convex storage
that's the right way to do it
why are these different? if you need to have "effects" -- use the network, do things that can fail half way through -- you have to use actions for that. a bit of background on that is in the tutorial, like here: https://docs.convex.dev/tutorial/actions
3: The platform in action | Convex Developer Hub
Learn about harnessing the broader backend platform capabilities to
Thanks, that helped me understand the problem.
Outside world
* Actions
Internal world (convex stuff)
* Mutations
What's the big difference between them?
Am I right?
yes, mutations are very fast, side-effect free functions that run "in the database", and can only affect the database. actions are more like normal javascript functions that can run for longer, call APIs, etc, conduct multiple database queries/mutations, etc.
Thanks a lot Jamie
no problem. happy to help