Displaying 1 result from an estimated 1 matches for "uploadio".
Did you mean:
uploaded
2011 Aug 19
1
How to post a file via HTTP as multipart/form-data to Facebook?
...require ''net/http/post/multipart''
url =
URI.parse(''https://graph.facebook.com/me/photos?access_token=#{params[:access_token]}'')
File.open(params[@tempfile]) do |jpg|
req = Net::HTTP::Post::Multipart.new url.path,
"file" => UploadIO.new(jpg, "image/jpeg", "image.jpg")
res = Net::HTTP.start(url.host, url.port) do |http|
http.request(req)
end
end
But:
1. It is not sending the data.
2. I cannot find how to send the params[:message] with the file in
order to have a caption for the im...