Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Friday, May 11, 2018 at 09:09amHello, I'm attempting to upload a PDF file using :
Upload a New Document through multipart/form-data
Based on this thread it appears it is possible to do this with UTL_HTTP as long as I post the binary output (and not base64, which I did try too and that also failed).
The code snippet below shows my initial HTTP Headers which points to a draft package in my sandbox.
l_upload_url := 'https://'||l_esignhost||'/api/packages/'||l_package_id||'/documents'; l_http_request := utl_http.begin_request( url => l_upload_url, method => 'POST', http_version => 'HTTP/1.1' ); utl_http.set_header(l_http_request, name => 'Authorization', VALUE => 'Basic '||l_api_key); utl_http.set_header(l_http_request, 'Accept','text/html'); utl_http.set_header(l_http_request, 'Content-Type', 'multipart/form-data; boundary="' || lco_boundary || '"'); utl_http.set_header(l_http_request, 'Content-Length', l_request_body_length+l_request_body_length_blob+l_request_body_length_post); -- I've also tried using Transfer-Encoding: chunked, but with the same resultsHere is my request:
SQL> @esign_blob1.sql Request post> ----THISxisMYxBoundary Content-Disposition: form-data; name="payload" { "name": "Test_2.pdf" } ----THISxisMYxBoundary Content-Disposition: form-data; name="file"; filename="Test_2.pdf" Content-Type: application/pdf Content-Transfer-Encoding: binaryAnything glaringly obvious as to what I'm doing wrong? Or have a method to determine why I'm getting a 500 ? Thanks! Andy K PS Apologies if this is a re-post. I submitted something similar earlier, but haven't seen any signs of it.-- This actually contains the calls to UTL_HTTP.WRITE_RAW ----THISxisMYxBoundary-- Response> Status Code: 500 Response> Reason Phrase: Internal Server Error Response> HTTP Version: HTTP/1.1 Response> Server: nginx Response> Date: Fri, 11 May 2018 17:03:51 GMT Response> Content-Type: application/octet-stream Response> Transfer-Encoding: chunked Response> Connection: close Response> X-Powered-By: Undertow Response> Allow: GET, POST, HEAD, PUT, PATCH, DELETE Response body> 500: Unhandled Server Error PL/SQL procedure successfully completed.
Reply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Friday, May 11, 2018 at 09:16amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Friday, May 11, 2018 at 12:44pmReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Monday, May 14, 2018 at 06:36amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Monday, May 14, 2018 at 07:49amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Monday, May 14, 2018 at 08:16amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Tuesday, May 15, 2018 at 05:23amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Tuesday, May 15, 2018 at 05:28amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Thursday, May 17, 2018 at 11:55amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Thursday, May 17, 2018 at 12:22pmReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Friday, May 18, 2018 at 05:03amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Friday, May 18, 2018 at 09:35amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Friday, May 18, 2018 at 10:09amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Friday, May 18, 2018 at 10:16amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Friday, May 18, 2018 at 10:28amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Friday, May 18, 2018 at 10:38amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Monday, May 21, 2018 at 09:34amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Monday, May 21, 2018 at 10:27amReply to: Trouble uploading a document through multipart/form-data via Oracle's UTL_HTTP
Tuesday, May 22, 2018 at 05:42am