Not sure whether this is relevant, But I could find that your policy has syntax error. I tried it on http://www.jsoneditoronline.org/
In your policy, I had to replace all the '
with "
and then I was able to validate it fine.
So here is the policy after replacing '
with "
{"expiration":"20020-01-01T00:00:00Z","conditions":[{"bucket":"S3-bucket"},["starts-with","$key","uploads/${filename}"],{"acl":"private"},{"success_action_redirect":"LOCALHOST"},["starts-with","$Content-Type"," "],["content-length-range",0,1048576]]}
OR with indentation:
{
"expiration": "20020-01-01T00:00:00Z",
"conditions": [
{
"bucket": "S3-bucket"
},
[
"starts-with",
"$key",
"uploads/${filename}"
],
{
"acl": "private"
},
{
"success_action_redirect": "LOCALHOST"
},
[
"starts-with",
"$Content-Type",
" "
],
[
"content-length-range",
0,
1048576
]
]
}