diff options
author | Marion Deveaud <marion.deveaud@siemens.com> | 2017-03-13 20:37:27 +0100 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-04-21 13:43:40 +0200 |
commit | d81c355aaba2f363c513a81336cc9a17510907ae (patch) | |
tree | 12e7d4daaf17646b72c9cac7f4348886cc1a610e /doc/api | |
parent | 38e30516e15826921dcd223fce88eb0e0fc5c578 (diff) | |
download | gitlab-ce-d81c355aaba2f363c513a81336cc9a17510907ae.tar.gz |
docs(api): add curl arguments for file uploadsiemens/gitlab-ce-uploads-api
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/projects.md | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/doc/api/projects.md b/doc/api/projects.md index 63f88a464f5..51de4fef7ff 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -859,6 +859,17 @@ Parameters: | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | | `file` | string | yes | The file to be uploaded | +To upload a file from your filesystem, use the `--form` argument. This causes +cURL to post data using the header `Content-Type: multipart/form-data`. +The `file=` parameter must point to a file on your filesystem and be preceded +by `@`. For example: + +```bash +curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --form "file=@dk.png" https://gitlab.example.com/api/v3/projects/5/uploads +``` + +Returned object: + ```json { "alt": "dk", @@ -868,8 +879,8 @@ Parameters: ``` **Note**: The returned `url` is relative to the project path. -In Markdown contexts, the link is automatically expanded when the format in `markdown` is used. - +In Markdown contexts, the link is automatically expanded when the format in +`markdown` is used. ## Project members |