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
- Gitlab function automation
Im trying to automate my function deployment using gitlabs ci/cd pipeline. Im currently failing trying to use the appwrite cli to create a new deployment. ```...
- User Limit Bug
How can I disable Appwrite client SDK registration? I have heard the solution to set the User Limit to 1. But everytime I set it to one it will automatically se...
- Create file is listing files instead of ...
This is a bit strange but, I cannot create files from within a funcion. I have tested with latest SDKs versions of node and python, both instead of creating the...