Cannot retrieve response body with URL uploader

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?

I’ve managed to get this working. Turns out I needed to listen to complete instead of upload_success in this case. That seems to more universally attach the responses to the files.

However, now I have a new problem. Companion seems to be uploading all the metadata about the files from the URL upload, but the file data is empty. So the backend sees the filename and other fields, and it even detects a field for uploading the file, but that file is zero-length. Why might that be?

It doesn’t happen with a raw XHR upload from Uppy-- the file comes across just fine in that case!

I have determined that this is an issue which only happens in Firefox, and have filed an issue accordingly.