Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I upload to CloudFront directly from the browser?

Now that CloudFront supports POST requests, is it possible to do browser-based uploads directly to CloudFront?

like image 476
yndolok Avatar asked Oct 03 '22 09:10

yndolok


1 Answers

In theory, yes. However, there are very serious issues with support for anything but the most simple upload requests from a browser. For example, support for uploads to S3 via CloudFront using the multipart upload API is not possible due to the fact that CloudFront rips off the Authorization header from all of these requests. Amazon appears to be unwilling to fix this issue. This means you cannot support chunked requests from the browser if you target a CF endpoint or make any REST calls that require an Authorization header.

There is also an issue the prevents you from targeting differing CloudFront distribution endpoints (in order to more easily target different S3 from the same CF domain).

like image 188
Ray Nicholus Avatar answered Oct 13 '22 11:10

Ray Nicholus