1

我正在尝试通过 POST 请求将图像上传到亚马逊:

    begin
      RestClient.post('http://public.domain.com/',
                      {
                        :transfer => {
                          :key => s3_key,
                          :acl => s3_acl,
                          :content_type => s3_content_type,
                          :AWSAccessKeyId => s3_AWSAccessKeyId,
                          :policy => s3_policy,
                          :signature => s3_signature
                        },
                        :upload => {
                          :file =>  File.new('/tmp/uup_1114.png', 'rb')
                        }
                      })
    rescue => e
      render :text => e.response
    end

作为回应,我得到

InvalidArgument
POST requires exactly one file upload per request.

RubyOnRails,RestClient。

4

1 回答 1

0

看看这个答案:https ://stackoverflow.com/a/9331205/1035438 ,这可能会帮助您解决问题。

于 2012-02-17T15:45:55.453 回答