0

I am trying to upload a file with the following call

RestClient::Request.execute(method: :post, url: Paperclip::Storage::Http::FILE_UPLOAD_LOCATION, password: Paperclip::Storage::Http::FILE_UPLOAD_KEY, timeout: 8, open_timeout: 8, payload: self.file)

where self.file is an ActionDispatch::Http::UploadedFile object but i am getting the following error:

NoMethodError: undefined method `closed?' for #<ActionDispatch::Http::UploadedFile:0xa8bd300>

What is the right way of uploading the file with timeout?

Marek Příhoda
  • 11,108
  • 3
  • 39
  • 53

1 Answers1

0

Probably self.file does not implement closed? method. Check if there is valid File instance