How to stop appending the jQuery-File-Upload plugin's JSON response

46 views
Skip to first unread message

Nawaz Ijaz

unread,
Feb 19, 2015, 1:15:59 AM2/19/15
to jquery-f...@googlegroups.com

Dear contributors, I am using this awesome plugin first time in our struts2 web application.
Its uploading the file successfully. Coming on our Struts action and am filling up the JSON "result" object like below.;
And this is the only JSON response which i want to pass to my call-back JSP/JQuery.

{
    "results": [
        {
            "ExcelPath": "/usr/local/apache-tomcat-7.0.39/webapps/Test/test.xlsx",
            "ExcelName": "test.xlsx",
            "TestExcelStatus": "success"
        }
    ]
}


But my problem is that the Jquery-file-upload plugin is adding up its own JSON response as well and messing up the whole response. (e.g. below)
Is there any way to stop appending / discard the plugin's JSON in my response?

{
    "results": [
        {
            "ExcelPath": "/usr/local/apache-tomcat-7.0.39/webapps/VUC/test.xlsx",
            "ExcelName": "test.xlsx",
            "TestExcelStatus": "success"
        }
    ]
}{
    "file": {
        "absolute": true,
        "absoluteFile": null,
        "absolutePath": "\/usr\/local\/apache-tomcat-7.0.39\/temp\/upload_e76db3f6_3789_4eb8_b46b_05637cdadea9_00000000.tmp",
        "canonicalFile": null,
        "canonicalPath": "\/usr\/local\/apache-tomcat-7.0.39\/temp\/upload_e76db3f6_3789_4eb8_b46b_05637cdadea9_00000000.tmp",
        "directory": false,
        "file": true,
        "freeSpace": 27087597568,
        "hidden": false,
        "name": "upload_e76db3f6_3789_4eb8_b46b_05637cdadea9_00000000.tmp",
        "parent": "\/usr\/local\/apache-tomcat-7.0.39\/temp",
        "parentFile": {
            "absolute": true,
            "absoluteFile": null,
            "absolutePath": "\/usr\/local\/apache-tomcat-7.0.39\/temp",
            "canonicalFile": null,
            "canonicalPath": "\/usr\/local\/apache-tomcat-7.0.39\/temp",
            "directory": true,
            "file": false,
            "freeSpace": 27087597568,
            "hidden": false,
            "name": "temp",
            "parent": "\/usr\/local\/apache-tomcat-7.0.39",
            "parentFile": {
                "absolute": true,
                "absoluteFile": null,
                "absolutePath": "\/usr\/local\/apache-tomcat-7.0.39",
                "canonicalFile": null,
                "canonicalPath": "\/usr\/local\/apache-tomcat-7.0.39",
                "directory": true,
                "file": false,
                "freeSpace": 27087597568,
                "hidden": false,
                "name": "apache-tomcat-7.0.39",
                "parent": "\/usr\/local",
                "parentFile": {
                    "absolute": true,
                    "absoluteFile": null,
                    "absolutePath": "\/usr\/local",
                    "canonicalFile": null,
                    "canonicalPath": "\/usr\/local",
                    "directory": true,
                    "file": false,
                    "freeSpace": 27087597568,
                    "hidden": false,
                    "name": "local",
                    "parent": "\/usr",
                    "parentFile": {
                        "absolute": true,
                        "absoluteFile": null,
                        "absolutePath": "\/usr",
                        "canonicalFile": null,
                        "canonicalPath": "\/usr",
                        "directory": true,
                        "file": false,
                        "freeSpace": 27087597568,
                        "hidden": false,
                        "name": "usr",
                        "parent": "\/",
                        "parentFile": {
                            "absolute": true,
                            "absoluteFile": null,
                            "absolutePath": "\/",
                            "canonicalFile": null,
                            "canonicalPath": "\/",
                            "directory": true,
                            "file": false,
                            "freeSpace": 27087597568,
                            "hidden": false,
                            "name": "",
                            "path": "\/",
                            "totalSpace": 32740646912,
                            "usableSpace": 25400860672
                        },
                        "path": "\/usr",
                        "totalSpace": 32740646912,
                        "usableSpace": 25400860672
                    },
                    "path": "\/usr\/local",
                    "totalSpace": 32740646912,
                    "usableSpace": 25400860672
                },
                "path": "\/usr\/local\/apache-tomcat-7.0.39",
                "totalSpace": 32740646912,
                "usableSpace": 25400860672
            },
            "path": "\/usr\/local\/apache-tomcat-7.0.39\/temp",
            "totalSpace": 32740646912,
            "usableSpace": 25400860672
        },
        "path": "\/usr\/local\/apache-tomcat-7.0.39\/temp\/up

Nawaz Ijaz

unread,
Feb 19, 2015, 5:37:32 PM2/19/15
to jquery-f...@googlegroups.com
Sorted it out by returning "NONE" instead of "SUCCESS" from my struts2 action.

Nawaz Ijaz

unread,
Feb 19, 2015, 5:38:58 PM2/19/15
to jquery-f...@googlegroups.com



On Thursday, February 19, 2015 at 5:15:59 PM UTC+11, Nawaz Ijaz wrote:
Reply all
Reply to author
Forward
0 new messages