Upload
The “upload-service” provides methods for multipart file uploading.
Requirements
AWS_KEY, AWS_SECRET, AWS_BUCKET, AWS_HOST must be in env
Also need set NGINX config for service:
client_max_body_size 600M;
Test example
Paste into your browser
data:text/html,<form action="https://dev.shping.com/upload-service/upload" enctype="multipart/form-data" method=post><input type="file" name="inputfile"/> <input type="submit"/> </form>
Reply |
---|
{ok, “link”} |
{error, “reason”} |
HTML example
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Multipart upload example</title>
</head>
<body>
<form method="post" enctype="multipart/form-data"
action="https://dev.shping.com/upload-service/upload">
<input type="file" name="inputfile"/>
<input type="submit"/>
</form>
</body>
</html>
API Example (AWS_KEY, AWS_SECRET, AWS_BUCKET must be in env)
ait_common_aws_lib:configure/0
ait_common_aws_lib:set_iodata/2
ait_common_aws_lib:get_iodata/1
ait_common_aw_lib:delete_iodata/1