Hi all.
I’m trying to add the URL uploader to uppy. I’ve got companion installed, and it uploads just fine. However, I need to get the response body back from the server upon successful upload.
With the XHR Uploader, the upload-success
hook returns a response
object with the response body content. However, with the URL uploader, the body content is not included. However, I know the frontend receives that data, because I can see it coming in over websocket in my browser’s debugging tools:
{"action":"success","payload":{"response":{"responseText":"{\"id\":\"3e3d7071-2b22-4c84-97a8-b4e630876d39\"}","status":200,"statusText":"OK","headers":{"server":"nginx/1.25.3","date":"Wed, 31 Jan 2024 19:49:52 GMT","content-type":"application/json","content-length":"45","connection":"close","vary":"Accept, Cookie","allow":"POST, OPTIONS","x-frame-options":"DENY","x-content-type-options":"nosniff","referrer-policy":"same-origin","cross-origin-opener-policy":"same-origin","access-control-allow-origin":"*"}},"bytesUploaded":2177908,"complete":true,"url":null}}
The responseText
key here is a raw string equal to what’s returned in the response.body
object for XHR Uploader. How can I get this information? Is there a preferred manner?