Skip to content

Wrapping POST response in JSON object #16

@B3nCr

Description

@B3nCr

Hi

I've been using your handler with the javascript files from the blueimp repository.

When a file is posted the handler returns an array of JSON objects with the details of the posted files, but the blueimp javascript expects an object with a single field "files" which contains the array.

So in WriteJsonIFrameSafe you have:

    string jsonObj = this._js.Serialize(statusList.ToArray());

and I have:

    string jsonObj = this._js.Serialize(new { files = statusList.ToArray() });

You can see in line 79 in jquery.fileupload-angular.js that the result should contain the files property

    var files = data.result && data.result.files;

I wasn't sure if you've changed your the javascript to match your handler response or if its out of sync with the latest code from blueimp.

I know it's only a one line fix but if you think it applies then I can clone your repo and submit a pull request. It'd be my first real contribution to the GitHub community :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions