Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-04-24 14:58:36 +0300
committerRémy Coutable <remy@rymai.me>2017-04-24 14:58:36 +0300
commitb2fd7731285a6bf3bca9ce1768c1756df2fe859f (patch)
tree319ae2cb0b12cf6b958bbe72948b88b002b75a09 /doc
parent90f73438998e9f6eaefd19c446569eed6cfae34d (diff)
parentd81c355aaba2f363c513a81336cc9a17510907ae (diff)
Merge branch 'siemens/gitlab-ce-uploads-api' into 'master'
docs(api): add curl arguments for file upload See merge request !10848
Diffstat (limited to 'doc')
-rw-r--r--doc/api/projects.md15
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