How can i get the response of a uploader?

  • hi
    i am using q-uploader, i have already upload files but i don’t know how to get a json response that php is sending back… i have a @uploaded=“fileUploaded” listener:

    fileUploaded(file, xhr) {
    console.log(“Success upload”,file,xhr)

    i thougth that xhr argument would contain my json, i have checked in the browser console and the response properties like “response”, “response type” and “response text” are empty

    i can see my json returned in the network panel… but i don’t know how to access it
    anyone knows how?
    thanks for your time.

  • you can get it by accessing xhr “xhr.response”
    fileUploaded(file, xhr) {
    hope this helps 🙂

  • what works for me was:

    fileUploaded(file, xhr) {
    let response = JSON.parse(xhr.response)


  • The response was received as an XMLHttpRequest object in the ‘file’ object.
    What I did was
    var r =new XMLHttpRequest()
    r = file.xhr

  • @uploaded -> function(info) has a Parameter “info” which has wo props: “files” and “xhr”.
    When you are doing following it works.

    In the QUploader:

    and in the methods:
    fileUploaded ({ files, xhr }) {

Log in to reply