Hello again, following the docs (https://appwrite.io/docs/products/storage/upload-download) using http im unable to upload/create a file, i got this error:
{"message":"Param \"fileId\" is not optional.","code":400,"type":"general_argument_invalid","version":"1.4.13"}
this is what im trying to construct:
// Set the required headers
data.headers = {
'Content-Type': 'multipart/form-data; boundary=cec8e8123c05ba25',
'X-Appwrite-Project': 'xxxxxxxxxxxxx'
};
// Build the form data
var formData = new FormData();
formData.append('operations', JSON.stringify({
query: "mutation CreateFile($bucketId: String!, $fileId: String!, $file: InputFile!) { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file) { id } }",
variables: {
bucketId: "yyyyyyyyyyyyyy",
fileId: "unique()",
file: null
}
}));
formData.append('map', { "0": ["variables.file"] });
formData.append('0', data.files[0]);
// Set the form data in the request
data.formData = formData;
}```
what im missing?
i already tried to set a `fileId` manually but same error occurs
Recommended threads
- How to bypass the rate limit on the back...
Once a month my app has a ton of usage and I always run into the Too many requests 429 error. I am trying to optimize the queues and jobs to manage that, but a...
- 401 - Project not accessible in this reg...
Hi Appwrite team, I’m experiencing a Cloud Console issue with my NYC region project. Problem: - Some Console pages return: “401 - Project is not accessible ...
- Hi, I'm getting a 403 error when I try t...
Project ID : 6797cdc1000c5078d8b9 Region : Frankfurt (fra) Error : "Project is paused due to inactivity. Please restore it from the console to resume o...