I have the following code
file_field = Curl::PostField.file 'file', 'image' do |file|
return File.open(temp_image, 'rb').read
end
curl = Curl::Easy.http_post(upload_url, file_field) do |curl|
curl.headers["User-Agent"] = "designtool-1.0"
curl.ssl_verify_host = false
curl.ssl_verify_peer = false
curl.timeout = 240
curl.multipart_form_post = true
curl.verbose = true
curl.on_debug { |type,data| print data }
end
It does not work in the sense that the post never fires (checked and double-checke, there is also no debug data printed to the screen). Instead, if I just do a http_get (which i do not actually want, because I need to post a file) it works just fine and debug data is printed to the screen.
I am using Ubuntu 12.04, curb 0.8.0. What seems to be the problem, I do not think my code is of fault.