Problem with upload function

Problem with upload function

torsten.muellertorsten.mueller Posts: 4Questions: 3Answers: 0
edited October 2015 in Free community support

Hello,

I have some problems with the file upload function.
It works great, I can upload a file and then save the record and it is saved in the backend.
But: the edit (or create new) dialog will stay in front and the ajax-loader image is running all the time. So I guess the response from the backend is wrong.

This is my request to the backend:

{
"action":"edit",
"data": {
"undefined": {
"id":18723736,
"application":"test",
"appLogo":"/upload/images/1443705355_example.JPG",
}
}
}

And this is the response:

{
"data": [
{
"id":18723736,
"action":"edit",
"application":"test",
"appLogo":"/upload/images/1443705355_example.JPG",
}
]
}

If I do the same without uploading a image, the reqeust and response is the same, but the appLogo is "".

Answers

  • allanallan Posts: 62,109Questions: 1Answers: 10,184 Site admin

    Hi,

    If you run your response through JSONLint you'll be able to see that the trailing comma makes it not valid. I suspect that is the problem (or one of them if there are multiple!).

    Are you able to change your response to be valid JSON?

    Allan

  • torsten.muellertorsten.mueller Posts: 4Questions: 3Answers: 0

    Hi allan,

    thanks for your response!
    Unfortunately that was not the issue. The response is a valid json. The additional comma was a copy/paste error.

  • allanallan Posts: 62,109Questions: 1Answers: 10,184 Site admin

    Does your browser's console show a Javascript error? That is normally the case when the loading spinner remains on screen indefinitely. If it does, what is that error (and ideally, what is the backtrace)?

    Allan

This discussion has been closed.