Giter Club home page Giter Club logo

upscan-upload-proxy's Introduction

upscan-upload-proxy

This is a placeholder README.md for a new repository

License

This code is open source software licensed under the Apache 2.0 License.

Purpose

Enrich the S3 api with the ability to redirect on failure. S3 can only redirect on successful file uploads.

POST v1/uploads/{destination}

Expects a destination path parameter which should be the S3 bucket name where we want to upload the file.

Headers

Content-Type	multipart/form-data
Content-Length	xxx

Body

error_action_redirect	https://www...

S3 allows a redirect url to be specified for successful file upload via a success_action_redirect form field.

This service enriches the S3 api to allow a redirect url to be specified for a failed file upload via a error_action_redirect form field.

Example request

POST v1/uploads/{bucket-name} HTTP/1.1
Host: upscan-upload-proxy-development-156735432.eu-west-2.elb.amazonaws.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Accept: */*
Cache-Control: no-cache
Host: xxx.execute-api.eu-west-2.amazonaws.com
accept-encoding: gzip, deflate
content-length: 1065
Connection: keep-alive
cache-control: no-cache


Content-Disposition: form-data; name="acl"

public-read-write
------WebKitFormBoundary7MA4YWxkTrZu0gW--,
Content-Disposition: form-data; name="acl"

public-read-write
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="Content-Type"

application/text
------WebKitFormBoundary7MA4YWxkTrZu0gW--,
Content-Disposition: form-data; name="acl"

public-read-write
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="Content-Type"

application/text
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="key"

helloworld.txt
------WebKitFormBoundary7MA4YWxkTrZu0gW--,
Content-Disposition: form-data; name="acl"

public-read-write
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="Content-Type"

application/text
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="key"

helloworld.txt
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="file"; filename="/HelloWorld.txt


------WebKitFormBoundary7MA4YWxkTrZu0gW--
curl -X POST \
  https://xxx.execute-api.eu-west-2.amazonaws.com/uploads/{bucket-name} \
  -H 'Accept: */*' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Host: ik3qo4pzt9.execute-api.eu-west-2.amazonaws.com' \
  -H 'User-Agent: PostmanRuntime/7.11.0' \
  -H 'accept-encoding: gzip, deflate' \
  -H 'cache-control: no-cache' \
  -H 'content-length: 1065' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F acl=public-read-write \
  -F Content-Type=application/text \
  -F key=helloworld.txt \
  -F [email protected]

upscan-upload-proxy's People

Contributors

chotai avatar hmrc-web-operations avatar thomas-vogel444 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.