Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
d81c355a
Commit
d81c355a
authored
Mar 13, 2017
by
Marion Deveaud
Committed by
Achilleas Pipinellis
Apr 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(api): add curl arguments for file upload
parent
38e30516
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
doc/api/projects.md
doc/api/projects.md
+13
-2
No files found.
doc/api/projects.md
View file @
d81c355a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment