Angular to s3上传图片

时间:2016-05-05 19:25:39

标签: angularjs image amazon-web-services amazon-s3 upload

我想使用ng-file-upload直接将图像发送到AWS S3存储桶。我发送的请求似乎没有得到处理。请求如下:

                  Upload.upload({
                    url: credentials.url, //S3 upload url including bucket name
                    method: 'POST',
                    data: {
                        key: "blob", // the key to store the file on S3, could be file name or customized
                        AWSAccessKeyId: credentials.fields.AWSAccessKeyId,
                        acl: 'public-read', // sets the access to the uploaded file in the bucket: private, public-read, ...
                        policy: credentials.fields.policy, // base64-encoded json policy (see article below)
                        signature: credentials.fields.signature, // base64-encoded signature based on policy string (see article below)
                        "Content-Type": file.type, // content type of the file (NotEmpty)
                        file: file
                    }
                });

有人能告诉我这出错的地方吗?

0 个答案:

没有答案