@@ -29,96 +29,6 @@ instead.
2929<%= headers 200 %>
3030<%= json : download %>
3131
32- ## Create a new download (Part 1: Create the resource)
33-
34- Creating a new download is a two step process. You must first create a
35- new download resource.
36-
37- POST /repos/:owner/:repo/downloads
38-
39- ### Input
40-
41- name
42- : _ Required_ ** string**
43-
44- size
45- : _ Required_ ** number** - Size of file in bytes.
46-
47- description
48- : _ Optional_ ** string**
49-
50- content\_ type
51- : _ Optional_ ** string**
52-
53- <%= json \
54- : name => "new_file.jpg",
55- : size => 114034,
56- : description => "Latest release",
57- : content_type => "text/plain"
58- %>
59-
60- ### Response
61-
62- <%= headers 201, : Location => "https://api.github.com/user/repo/downloads/1 " %>
63- <%= json : create_download %>
64-
65- ## Create a new download (Part 2: Upload file to s3)
66-
67- Now that you have created the download resource, you can use the
68- information in the response to upload your file to s3. This can be done
69- with a ` POST ` to the ` s3_url ` you got in the create response. Here is a
70- brief example using curl:
71-
72- curl \
73- -F "key=downloads/octocat/Hello-World/new_file.jpg" \
74- -F "acl=public-read" \
75- -F "success_action_status=201" \
76- -F "Filename=new_file.jpg" \
77- -F "AWSAccessKeyId=1ABCDEF..." \
78- -F "Policy=ewogIC..." \
79- -F "Signature=mwnF..." \
80- -F "Content-Type=image/jpeg" \
81- -F "file=@new_file.jpg" \
82- https://github.s3.amazonaws.com/
83-
84- NOTES
85-
86- The order in which you pass these fields matters! Follow the order shown
87- above exactly. All parameters shown are required and if you excluded or
88- modify them your upload will fail because the values are hashed and signed
89- by the policy.
90-
91- key
92- : Value of ` path ` field in the response.
93-
94- acl
95- : Value of ` acl ` field in the response.
96-
97- success_action_status
98- : 201, or whatever you want to get back.
99-
100- Filename
101- : Value of ` name ` field in the response.
102-
103- AWSAccessKeyId
104- : Value of ` accesskeyid ` field in the response.
105-
106- Policy
107- : Value of ` policy ` field in the response.
108-
109- Signature
110- : Value of ` signature ` field in the response.
111-
112- Content-Type
113- : Value of ` mime_type ` field in the response.
114-
115- file
116- : Local file. Example assumes the file existing in the directory where
117- you are running the curl command. Yes, the ` @ ` matters.
118-
119- More information about using the REST API to interact with s3 can
120- be found [ here] ( http://docs.amazonwebservices.com/AmazonS3/latest/API/ ) .
121-
12232## Delete a download
12333
12434 DELETE /repos/:owner/:repo/downloads/:id
0 commit comments