
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
- phantom relationships appear on parent c...
i have this bug were my past deleted collection apears as relationship to my parent collection. when i try to delete that relationship from parent it gives me e...
- Attribute stuck on proccessing
i tried creating a new attribute butits stuck on proccessing,i did a hard refresh,cleared cache everything but still stuck on proccessing,also in my functions w...
- Appwrite Cloud Custom Domains Issue
Iām trying to configure my custom domain appwrite.qnarweb.com (CNAME pointing to fra.cloud.appwrite.io with Cloudflare proxy disabled) but encountering a TLS ce...
