
client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('647170480f75d7bd5b41') // Your project ID ;
methods: { handleFileUpload(event) { this.file = event.target.files[0]; }, async submitFile() { try { const response = await storage.createFile('64717d445b7a640fc647', ID.unique(), document.getElementById('file').files[0]); console.log(response); // Success } catch (error) { console.log(error); // Failure } }
}

import { Client, Storage, ID } from "appwrite";

Like this

Alright

Still having the same CORS error : Acess to XMLHttpRequest at 'https://cloud.appwrite.io/v1/storage/buckets/64717d445b7a640fc647/files' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

When i tried to upload

What else do you get in the console?
As localhost
should be enabled

These are what I'm seeing on my console
AppwriteException: Network request failed at Client.eval (webpack-internal:///./node_modules/appwrite/dist/esm/sdk.js:423:23) at Generator.throw (<anonymous>) at rejected (webpack-internal:///./node_modules/appwrite/dist/esm/sdk.js:42:65) browser-ponyfill.js:518 POST https://cloud.appwrite.io/v1/storage/buckets/64717d445b7a640fc647/files net::ERR_FAILED 404 eval @

So it's still 404
Can you check two things
- That this bucket is indeed inside this project and it has the necessary permissions.
- Share a screenshot of the preview tab inside the
network
tab

Yes.
Please can you explain what you meant in 2 ?


This is it, it's not showing any data

And the one after?

Same input

Everything looks allright. Can you share your bucket settings screen?

I ticked all


Is the URL is like this?
console/project-647170480f75d7bd5b41/storage/bucket-64717d445b7a640fc647/settings
With this IDs?

Yes it is

When I'm running this credentials it having problem finding the project ID

So the project ID is the issue ?

This the error i always get when i click to read the error:
{"message":"Storage bucket with the requested ID could not be found.","code":404,"type":"storage_bucket_not_found","version":"0.10.22"}

Hello @Binyamin i have solved it

[SOLVED] FIle Upload: CORS Error policy

Cool ππ
Recommended threads
- Struggling with Sessions
Understanding check: createAnonymousSession() registers the session with the backend setSession() creates a cookie on the userβs computer(?) getSession(βcurr...
- MCP and VSCode Docs
I like your tools, but would like to set up Copilot in VSCode, but these docs don't offer that guide. Did I miss something? https://appwrite.io/docs/tooling/mcp
- How to set wildcard at custom doamin
For OAuth2 redirect, I have set the appwrite api endpoint as appwrite.example.com, and added the CANME in cloudfare where I bought the domain name. And I hosted...
