appwrite/docs/examples/1.2.x/server-graphql/examples/storage/create-file.md
2022-12-26 13:17:28 +01:00

828 B

POST /v1/storage/buckets/{bucketId}/files HTTP/1.1 Host: HOSTNAME Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ... Content-Length: Length of your entity body in bytes

--cec8e8123c05ba25 Content-Disposition: form-data; name="operations"

{ "query": "mutation { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file) { id }" }, "variables": { "bucketId": "[BUCKET_ID]", "fileId": "[FILE_ID]", "file": null } }

--cec8e8123c05ba25 Content-Disposition: form-data; name="map"

{ "0": ["variables.file"] }

--cec8e8123c05ba25 Content-Disposition: form-data; name="0"; filename="file.ext"

File contents

--cec8e8123c05ba25--