ruby on rails - Getting Connection reset by peer - SSL_connect error while uploding file to another app -
currently have rails application. have implement functionality upload file application.
the given application uses 3-legged oauth security. have following architecture
- first create file id using post call (https://www.example.com/org/files)
- then of above file id, upload file using put call (https://www.example.com/files)
i have able create fileid. while making put call (uploading file) getting errno::econnreset: connection reset peer - ssl_connect
error.
so how can upload file in chunk. here sample code uploading file.
file_data = file.open("/home/test/downloads/rechargereceipt.pdf") {|io| io.read} file_data_64 = base64.encode64(file_data) access_token.put("/org/files/3156906966", { 'content' => file_data_64 }.to_json, { 'accept' => 'application/vnd.axiom.v3+json', 'content-type' => 'application/octet-stream' } )
i using rails 4.
there issue while passing body parameters.
data = file.read(params[:file].path) access_token.put("/org/files/#{file_id}", data, { 'accept' => johndeere::accept, 'content-type' => content_type } )
Comments
Post a Comment