php-从浏览器直接上传到S3(Amazon)和https麻烦

我创建了一个页面,用户可以从中上传文件.此代码段将这些文件发送到我的Amazon S3存储桶.

<form action="https://BUCKET.s3-eu-west-1.amazonaws.com/" method="post" enctype="multipart/form-data">
  <input type="hidden" name="awsAccessKey" value="ACCESS_KEY">
  <input type="hidden" name="awsSecretKey" value="SECRET_KEY"> 
  <input type="hidden" name="acl" value="private"> 
  <input type="hidden" name="policy" value="POLICY">
  <input type="hidden" name="signature" value="SIGNATURE">
  <input type="hidden" name="Content-Type" value="">
  <!-- Include any additional input fields here -->

  File to upload to S3: 
  <input name="file" type="file"> 
  <br> 
  <input type="submit" value="Upload File to S3"> 
</form> 

一切正常,但我面临着https问题.主要浏览器不信任s3-eu-west-1.amazonaws.com,并显示有关不可信连接的安全消息.

我将HTTPS连接更改为HTTP,这样我的客户就不会遇到任何问题.有人对如何解决此问题有任何想法吗?

解决方法:

您的存储桶名称中可能有一个点.亚马逊的S3通配符证书仅适用于一个级别的子域,因此bucket.s3-eu-west-1.amazonaws.com很好,而bucket.bucket.s3-eu-west-1.amazonaws.com则不是.使用此代替:

https://s3-eu-west-1.amazonaws.com/BUCKET/

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...