I want to upload images to Appwrite buckets using Editor.JS It is very simple. This is what you have to do:
image: {
class: ImageTool,
config: {
endpoints: {
byFile: 'http://localhost:8008/uploadFile', // Your backend file uploader endpoint
byUrl: 'http://localhost:8008/fetchUrl', // Your endpoint that provides uploading by Url
}
}
}
}
However, I am not sure what to put in byFile or byUrl. So I did this:
image: {
class: ImageTool,
config: {
endpoints: {
byFile: 'https://cloud.appwrite.io/v1/storage/files?projectId=648bc5020fbda818412e', // Your Appwrite endpoint for uploading files
byUrl: 'https://cloud.appwrite.io/v1/storage/files?projectId=648bc5020fbda818412e&url=64ada07bbca91d21cdbc', // Your Appwrite endpoint for fetching files by URL
},
additionalRequestHeaders: {
'X-Appwrite-Project': '648bc5020fbda818412e', // Your Appwrite project ID
'X-Appwrite-Key': 'f3532846cc90b31dfa0d46ea92f7c5b56fab919f08e6fca87b4148a0576a5a962c1716a3dba8f140169bbddaad977c533cb58acece1380c4d4ce90eff638a037f667571af4d2f58d28ec6a033d1f8e3cb064a5a7599e6056ef1e75efe4d48e19f206a8ed925b7eca68788722dc5d7f17cc2bb129cb6ef3c73dbae96b0e02e2d3', // Your Appwrite API key
},
},
},
But it gives me this error:
{
"message": "Param \"fileId\" is not optional.",
"code": 400,
"type": "general_argument_invalid",
"version": "0.10.45"
}
Please help!
I apologize for the formatting.
I am getting a new error
Access to XMLHttpRequest at 'https://appwrite.io/v1/storage/files' from origin 'http://127.0.0.1:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
@Binyamin or @Steven Your help will be appreciated
please do not tag people directly as it can be very distruptive. pelase just post and wait for a response
okay
This looks interesting. If you won't find a solution I can look into it later today
I am sorry for pinging you guys
Recommended threads
- Project restoration button in console
The project restore button in console is taking no effect, i have tried several times and still nothing, it gives same popup if i reload
- 1.9.5 Migration problem
1.9.5 migration problem after run migration command only openruntimes-executor
- Appwrite Sites deployment fails because ...
Appwrite Cloud Sites deployments are failing consistently for both GitHub and manual deployments. The build command completes successfully and packaging also c...