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
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Deploy function not working - 503
Hellon i get this error message, when i try to deploy a new version of a function <html><body><h1>503 Service Unavailable</h1>No server is available to handle...