0

I'm trying to upload a file to via Google ruby API client. This works

media = Google::APIClient::UploadIO.new('test.jpg', 'image/jpeg')

but this does not work

media = Google::APIClient::UploadIO.new('http://www.somedomain.com/test.jpg', 'image/jpeg')

How would i upload media from a remote server such as s3?

Darren Cato
  • 1,382
  • 16
  • 22
  • Use `Net::HTTP` or something to download to your server first? Or is that not a viable solution? – max Apr 25 '14 at 22:16
  • Yeah i suppose my next option is to create a tempfile. but it seems wasteful to download the file on my server just to send it to another remote server. For an image its not a big deal, but it may be a problem for a video. I was hoping there the api would handle it. – Darren Cato Apr 28 '14 at 21:26

1 Answers1

0

I could not find the solution i wanted to this question. I ended up using Ruby Tempfile class which will download external files to my server in a temp folder and delete garbage collect once its done.

There is a great explanation of how to use this class here

Darren Cato
  • 1,382
  • 16
  • 22