1

POSTリクエストを介してAmazonに画像をアップロードしようとしています:

    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 に答える