views:

62

answers:

1

I'm having problems uploading a file through the OAuth gem (0.3.6).

The way I call it is:

response = @access_token.put( args[ 0 ], args[ 1 ],
    { 'Accept' => 'application/xml', 'Content-Type' => 'multipart/form-data' } )

args is an array, [ 0 ] is the url I want to send the multipart form, [ 1 ] is the hash of parameters. I'm using Sinatra, what I have is something like this:

"videobrief"=>{:type=>"application/octet-stream", :tempfile=>#<File:/var/folders/JG/JGhrAAe4E08VYSc++SCvek+++TI/-Tmp-/RackMultipart20091030-23052-mm7y4w-0>, :name=>"contest[videobrief]", :filename=>"Zooppa_Video.flv", :head=>"Content-Disposition: form-data; name=\"contest[videobrief]\"; filename=\"Zooppa_Video.flv\"\r\nContent-Type: application/octet-stream\r\n"}

Magically turned by Oauth/Rails/Go figure in:

"videobrief"=>"typeapplication/octet-streamtempfile#<File:0x102109bb0>namecontest[videobrief]filenameZooppa_Video.flvheadContent-Disposition: form-data; name=\"contest[videobrief]\"; filename=\"Zooppa_Video.flv\"\r\nContent-Type: application/octet-stream\r\n"}

I'm clueless. Someone already implemented this ?

Thanks in advance.

A: 

Hi *, there's not solution. I'm basically patching restclient to make it work with uploads and OAuth.

ngw