uppy
uppy copied to clipboard
getResponseData() fails when responseType is set to 'blob'
When using the XHR Upload plugin, setting the responseType
to 'blob'
instead of default 'text'
leads to the plugin failing with the following error:
It seems to be an issue with the way the plugin handles xhr.responseText
if there is none:
Yep…the default implementations of getResponse{Data,Error}
should probably return null
if the responseText
is empty/not a string.
Do you mind if I submit a PR to fix this?
Okay so I think that if I change all instances of xhr.responseText
to xhr.response
in the main file of XHR-Upload, it works fine. I tested it with a route that returns JSON and temporarily added a route to the xhr-bundle
example which sends back the same file that was sent. Both function well, if you pass a custom getResponseData
function
EDIT:
I can pretty easily configure the default getResponseData
function to work with both, currently testing that
@ajkachnic how is that implementation going? Are you willing to finish it? If not could you go over the changes to make it easy for others to pickup what you already thought out?
We got the same issue.
Any progress?
Any one working on this bug? I am happy to fix this with a PR.
PRs are very welcome! :)