Загрузка RestClient в Amazon завершается с ошибкой InvalidArgument - PullRequest
1 голос
/ 16 февраля 2012

Я пытаюсь загрузить изображение через 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.

1 Ответ

0 голосов
/ 17 февраля 2012

Посмотрите на этот ответ: https://stackoverflow.com/a/9331205/1035438, это может помочь вам решить вашу проблему.

...