Rank 3: Container
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!