Javascript Froala编辑AWS S3 CORS问题
我已经在Angular 4应用程序中实现了Frola编辑器。我试图上传AWS S3上的图像,但我得到了CORS错误。 这是我的档案 服务器端(用于生成签名): 这是我的角度组件文件:Javascript Froala编辑AWS S3 CORS问题,javascript,angular,amazon-web-services,amazon-s3,froala,Javascript,Angular,Amazon Web Services,Amazon S3,Froala,我已经在Angular 4应用程序中实现了Frola编辑器。我试图上传AWS S3上的图像,但我得到了CORS错误。 这是我的档案 服务器端(用于生成签名): 这是我的角度组件文件: //initialize froala after getting the signature public initialize(initControls) { this.froala = initControls; this._RestService.getEditorSignature().s
//initialize froala after getting the signature
public initialize(initControls) {
this.froala = initControls;
this._RestService.getEditorSignature().subscribe(
d => {
this.editorOptions['imageUploadToS3'] = d;
this.froala.initialize();
});
}
以下是我的Cors配置:
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>http://localhost:4200</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authoriz</AllowedHeader>
</CORSRule>
</CORSConfiguration>
我也尝试在和中使用“*”,但仍然不起作用。
有人能给我指出正确的方向吗?事实上,一切都很顺利。我把区域从s3改为ap-south-1。
我误判了水桶区域
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>http://localhost:4200</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authoriz</AllowedHeader>
</CORSRule>
</CORSConfiguration>