Nuxeo : Upload using presigned URL - amazon-s3

I want to generate a presigned URL for an S3 bucket, and upload files using the url, not through nuxeo server or the direct upload option.
The documentation, says, that I need to set the CloudFrontBinaryManager as the binary manager to be used. Despite, setting the configuration in nuxeo.conf, I am not able to upload directly to the bucket. I still see the request made to /upload, which routes the upload through the nuxeo server to the s3 bucket.
The downloads happen through the presigned url, but the upload doesn't. How can I make the upload work?

Related

Cloudfront prohibit a user from using a read-presigned url to make an upload

Using the cloudfront to read and write in the same S3 bucket, how can I prohibit a user from using a read-presigned url to make an injection (upluad)?
Thanks.
Deny access to PUT for cloudfront and it won't be able to put data into s3. In s3 permissions you can allow read only calls from cloudfront only. Turn off public access on s3, to make sure it will allow gets only from cloudfront. On CloudFront use this to update s3 bucket access, before this disable any public access on s3. CF will update S3's policy & create CF origin access identity:
To put data into S3, use presigned URL and it all goes down to the place where you create the presigned URL for upload. You may have api gateway RESTfull tiny api which would authenticate user to get the upload url and would return the upload url, which would be used by user to upload data to S3.

Attach S3 bucket to URL endpoint

How can I attach an S3 bucket to an URL on my site. I tried but could not get it to work.
For instance my URL is:
mysite.com/media
And my S3 bucket should be linked directly to the above URL?
You're going to want to use CloudFront in front of S3. This will allow you to use your domain and serve content from S3.
Check out Using CloudFront with Amazon S3 for details on how to do it.

S3 ACL Public-Read on Swisscom Cloud

AFAIK Swisscom does not support Uploads into the S3 Service with a public-read status. The only way to share a file is via presigned url. Is this correct? Already asked here:
How to serve user-uploaded files on Swisscom Application Cloud?
In the docs, it's written though that PUT Object ACLis supported. According to the Amazon Specs this should include public-read as well.
What is the current case now? What is the best workaround if it's not possible to store public readable binaries? For example to serve images for a website stored on Swisscom S3?
Swisscom Dynamic Storage currently does not support static web pages, which means every http request has to be signed. Workaround are shareable URLs with a very long expiration date so called Pre-signed Object URL.

Why CORS settings is not needed when we upload to S3 via `aws-sdk` gem

I have a rails app which have feature to uploads files on S3. For this purpose, I am using aws-sdk gem. The files are being uploaded to S3 but files first gets uploaded to server and then the files are being transferred to S3.
To make it quick, I switched to Jquery-file-upload plugin which allows me to upload files directly to S3 without server's intervention. However, to support this I needed to add CORS configurations to my S3 bucket.
So question is, why CORS configuration was not needed earlier when I was uploading the file via aws-sdk gem?
CORS is used to get around the same origin policy which restricts which hosts you are allowed to connect to from your client side script. It only applies in the browser. There are no such restrictions on your server side app or the server-to-server connection you use to forward files from your server.

Uploading Multiple Images to Amazon s3 with HTML, javascript & jQuery with Ajax Request (No PHP or Server)

I am developing a website in HTML, javascript & jQuery. I want to upload (multiple images) to amazon s3 server in an ajax request. There is no such SDK to integrate s3 in Javascript. A PHP SDK is available, but it is not useful to me. Can anybody provide solution to this in javascript?
You can read the article - How to Upload Scanned Images to Amazon S3 Using Dynamic Web TWAIN, which introduces how to use PHP and JavaScript to upload files to Amazon S3. Key steps include:
Specify the bucket which is the place or the folder name used for
storing data on Amazon S3
Specify the Access Key and Secret Key you
obtained from your Amazon S3 account
Create a policy that specifies
what you permit and what you don’t permit for the data uploaded from a
client web page
Encode and encrypt these policies and signatures to
keep them confidential, and store the encoded and encrypted values in
the hidden input elements.