【问题标题】:AWS::S3::SignatureDoesNotMatch exception when copying/renaming a non-latin named file in S3在 S3 中复制/重命名非拉丁命名文件时出现 AWS::S3::SignatureDoesNotMatch 异常
【发布时间】:2011-07-28 13:40:41
【问题描述】:

我只对带有希伯来字符的文件出现此异常:

AWS::S3::SignatureDoesNotMatch( 我们计算的请求签名确实 与您提供的签名不符。 检查您的密钥和签名方法。)

与S3建立连接后的代码是:

AWS::S3::S3Object.rename(
  resource_file_name,
  new_resource_file_name,
  bucket,
  {:content_type => resource_content_type} )

【问题讨论】:

    标签: ruby-on-rails ruby unicode amazon-s3


    【解决方案1】:

    只编码第一个文件名解决了这个问题:

    AWS::S3::S3Object.rename(
      URI.encode(resource_file_name),
      new_resource_file_name,
      bucket,
      {:content_type => resource_content_type} )
    

    【讨论】:

    • 我希望有人能解释这背后的逻辑是什么,以及它是否是一个错误......
    • 也为我工作。感谢您的解决方案。
    猜你喜欢
    • 2011-07-26
    • 2012-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-21
    • 2014-06-15
    相关资源
    最近更新 更多