appwrite/docs/examples/1.3.x/client-graphql/examples/storage/create-file.md
2023-04-12 01:23:29 +12:00

778 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-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--