Skip to content
Browse files

Merge pull request #1277 from matteo-hertel/master

Examples, S3: Add region to URL.
  • Loading branch information...
2 parents 59eee7c + a6ea3bf commit b5da3bf6f0ea555dbc6c604f141c643ca4352062 @jayarjo jayarjo committed Apr 30, 2016
Showing with 6 additions and 1 deletion.
  1. +6 −1 examples/jquery/s3.php
View
7 examples/jquery/s3.php
@@ -17,6 +17,7 @@
// important variables that will be used throughout this example
$bucket = 'BUCKET';
+$region = "REGION" //S3 region e.g. eu-west-1
// these can be found on your Account page, under Security Credentials > Access Keys
$accessKeyId = 'ACCESS_KEY_ID';
@@ -83,7 +84,11 @@
$(function() {
$("#uploader").plupload({
runtimes : 'html5,flash,silverlight',
- url : 'http://<?php echo $bucket; ?>.s3.amazonaws.com/',
+ /*
+ * Sometime S3 will redirect the bucker url 'http://<?php echo $bucket; ?>.s3.amazonaws.com/' to
+ * https://<?= $bucket ?>.{region}.amazonaws.com the header sent is a 307 and it will break pupload
+ */
+ url : 'https://<?= $bucket ?>.<?= $region ?>.amazonaws.com/',
multipart: true,
multipart_params: {

0 comments on commit b5da3bf

Please sign in to comment.
Something went wrong with that request. Please try again.