Skip to content

Commit

Permalink
Mention file type during attachment upload (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem authored Oct 18, 2024
1 parent 11b2675 commit 200bba9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/tutorial-attachments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,20 @@ Suppose that we want to attach a file (``/home/mathieu/DAFSA.bin``) to the exist
curl -X POST ${SERVER}/buckets/${BUCKET}/collections/${COLLECTION}/records/${RECORD}/attachment \
-H 'Content-Type:multipart/form-data' \
-F attachment=@$FILEPATH \
-F attachment=@$FILEPATH;type=application/vnd.dafsa \
-u user:pass
And in order to create a record with both attributes and attachment, you'll have a generate a record id yourself.
If not specified, the file type of the uploaded attachment is determined from the file extension, with ``application/octet-stream`` by default (see *CDN compression* below).

And in order to create a new record with both attributes and attachment, you'll have a generate a record id yourself.

.. code-block:: bash
RECORD_ID=`uuidgen`
curl -X POST ${SERVER}/buckets/${BUCKET}/collections/${COLLECTION}/records/${RECORD_ID}/attachment \
-H 'Content-Type:multipart/form-data' \
-F attachment=@$FILEPATH \
-F attachment=@$FILEPATH;type=application/vnd.dafsa \
-F 'data={"name": "Mac Fly", "age": 42}' \
-u user:pass
Expand Down

0 comments on commit 200bba9

Please sign in to comment.