문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top