# Cannot retrieve response body with URL uploader

**URL:** <https://community.transloadit.com/t/cannot-retrieve-response-body-with-url-uploader/16986>\
**Category:** Uppy\
**Created:** [January 31, 2024, 7:54pm UTC](https://community.transloadit.com/t/cannot-retrieve-response-body-with-url-uploader/16986 "2024-01-31T19:54:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kelketek](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/kelketek/32/1078_2.png) [@Kelketek](https://community.transloadit.com/u/Kelketek)\
**Post date:** [January 31, 2024, 7:54pm UTC](https://community.transloadit.com/t/cannot-retrieve-response-body-with-url-uploader/16986/1 "2024-01-31T19:54:01Z")

</div>

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:

```auto
{"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?

---

<div class="post-metadata">

**Author:** ![Kelketek](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/kelketek/32/1078_2.png) [@Kelketek](https://community.transloadit.com/u/Kelketek)\
**Post date:** [February 1, 2024, 11:02pm UTC](https://community.transloadit.com/t/cannot-retrieve-response-body-with-url-uploader/16986/2 "2024-02-01T23:02:26Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Kelketek](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/kelketek/32/1078_2.png) [@Kelketek](https://community.transloadit.com/u/Kelketek)\
**Post date:** [February 2, 2024, 6:45pm UTC](https://community.transloadit.com/t/cannot-retrieve-response-body-with-url-uploader/16986/3 "2024-02-02T18:45:11Z")

</div>

I have determined that this is an issue which only happens in Firefox, and have [filed an issue accordingly](https://github.com/transloadit/uppy/issues/4909).
