kfirba / directo Goto Github PK
View Code? Open in Web Editor NEWA library to generate signatures for direct upload to Amazon S3
License: MIT License
A library to generate signatures for direct upload to Amazon S3
License: MIT License
Hello!
is there any config that could be set to make files > 5gb upload correctly to s3? it seems it ust be multiparted uploaded.
Thanks
thank you for this package,
Iam using Fineuploader's s3 mode and Iam generating the signature and policy (endpoint) for V4 on backend using this package, and this package uses its own policy inputs when singing the policy:
$policy = [
'expiration' => $this->expirationDate(),
'conditions' => [
['bucket' => $this->bucket],
['acl' => $this->options->acl],
['starts-with', '$key', $this->options->valid_prefix],
[$contentTypePrefix, '$Content-Type', $this->options->content_type],
['content-length-range', 0, $this->mbToBytes($this->options->max_file_size)],
['success_action_redirect' => $this->options->success_action_redirect],
['success_action_status' => $this->options->success_action_status],
['x-amz-credential' => $this->credentials->AMZCredentials()],
['x-amz-algorithm' => 'AWS4-HMAC-SHA256'],
['x-amz-date' => gmdate('Ymd\THis\Z', $this->time)]
]
];
Fineuploader by default will set request payload for the file Iam trying to upload ( which is different from the policy I signed using this package):
{"expiration":"2018-03-16T09:10:45.082Z",
"conditions":
\[{"acl":"private"},
{"bucket":"bucket-name"},
{"Content-Type":"image/jpeg"},
{"success\_action\_status":"200"},
{"x-amz-algorithm":"AWS4-HMAC-SHA256"},
{"key":"37f86eae-46e9-4047-91c1-c8ee2cbf90b6.jpg"},
{"x-amz-credential":"GWRQRFFXBA3C3S7GOVQQ/20180316/eu-central-1/s3/aws4\_request"},
{"x-amz-date":"20180316T090545Z"},
{"x-amz-meta-qqfilename":"JPG-GG\_400x400.jpg"},
\["content-length-range","0","23424"\]\]}
so for example , Fineuploader will set x-amz-date: 20180316T090545Z in request payload for the file and this package will set some different value for x-amz-date, so when I try to upload the file I will face many errors, like:
policy doesn't match ... etc ..
Is there any workaround?
Do you have any demo project including JS code that you can share? :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.