Commit b2fd7731 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'siemens/gitlab-ce-uploads-api' into 'master'

docs(api): add curl arguments for file upload

See merge request !10848
parents 90f73438 d81c355a
...@@ -859,6 +859,17 @@ Parameters: ...@@ -859,6 +859,17 @@ Parameters:
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | | `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 | | `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 ```json
{ {
"alt": "dk", "alt": "dk",
...@@ -868,8 +879,8 @@ Parameters: ...@@ -868,8 +879,8 @@ Parameters:
``` ```
**Note**: The returned `url` is relative to the project path. **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 ## Project members
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment