i am having issues with cors headers when trying to upload images from my front-end
Hi there, i am tryna setup image upload from my front end to my convex backend ,but whenever i try to upload the images i get this error, "No 'Access-Control-Allow-Origin' header is present on the requested resource."
i have followed what docs adviced by setting cors for preflight, but it doesnt seem to work.
i am using localhost:3000
how do i get pass this issue?
5 Replies
Can you share the action code?
Hey @NerdkidChiki , check out
https://github.com/get-convex/convex-demos/blob/main/file-storage-with-http/convex/http.ts
Or skip using HTTP actions altogether with:
https://uploadstuff.dev/
GitHub
convex-demos/file-storage-with-http/convex/http.ts at main · get-co...
Demo apps built on Convex. Contribute to get-convex/convex-demos development by creating an account on GitHub.
Thanks so much....i later used the url method and it worked like a charm. I don't think am ever gonna try that http action method again. I mostly focus on frontend so i really don't understand any of that Cors stuff, although i did read up on it on Mdn, it still was confusing 😞
Hey there ....i wanna know if its possible to arrange my files in storage by folders or how do i manage my files in storage?
Assuming i wanna store pdf files ina separate folder and images in a separate folder and images in a separate folder etc
Hey @NerdkidChiki, you can create a table (or tables) for managing stored files. For example a table with a "folder" field that references the Storage ID (also can store the file name).
I will try rhat.thankd so much