
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:
TypeScript
// 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
TL;DR
Developers are encountering an error stating "Param 'fileId' is not optional" when trying to upload/create a file using Appwrite's storage feature. The issue likely stems from the missing 'fileId' parameter in the request payload. To resolve this, ensure the 'fileId' is included in the request body along with the other required parameters.Recommended threads
- Self hosted cant login when behind rever...
Hello, I have setup appwrite behind nginx proxy manager, with the help of this link I found in the forum: https://medium.com/@stnguyen90/how-to-run-appwrite-be...
- Appwrite Fra 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...
- Appwrite service :: getCurrentUser :: Us...
Getting this error while creating a react app can someone please help me solve the error
