qiniu v0.4.0 Qiniu.Uploader
For uploading.
Link to this section Summary
Functions
Upload a file directly. See http://developer.qiniu.com/docs/v6/api/reference/up/upload.html
Link to this section Functions
Link to this function
upload(put_policy, local_file, opts \\ [])
Upload a file directly. See http://developer.qiniu.com/docs/v6/api/reference/up/upload.html
Example
put_policy = %Qiniu.PutPolicy{scope: "books", deadline: 1427990400}
Qiniu.Uploader.upload put_policy, "~/cool.jpg", key: "cool.jpg"
# =>
%HTTPoison.Response{
body: "body",
headers: %{"connection" => "keep-alive", "content-length" => "517", ...},
status_code: 200
}
Fields
put_policy- PutPolicy structlocal_file- path of local file
Options
:key- file name in a Qiniu bucket:crc32- crc32 to check the fileothers- Custom fieldsatom: "string", e.g.foo: "foo", bar: "bar"