【问题标题】:plupload decode uploadcomplete resonseplupload 解码 uploadcomplete resonse
【发布时间】:2022-01-14 17:00:34
【问题描述】:

我正在尝试解码 plupload 响应并提取凭证 ID 的值 我头昏脑胀,画一片空白 有什么建议吗?

FileUploaded: function(up, file, response) {
                    console.log("UPLOAD COMPLETED!!!")
                    console.log("RESPONSE ",response);
                    console.log(JSON.stringify(response));
                    console.log(jQuery.parseJSON(response));
                },

例如下面的响应

{response: '{"OK":1,"info":{"name":"hedge bnackground.jpg","pa…ackground.jpg","size":"185738","voucher_id":"0"}}', status: 200, responseHeaders: 'access-control-allow-origin: *\r\ncache-control: no-…: Apache/2.4.41 (Ubuntu)\r\nvary: Accept-Encoding\r\n'}

【问题讨论】:

    标签: javascript jquery json plupload


    【解决方案1】:
                        FileUploaded: function(up, file, information) {
                        console.log("INFO ",information);
                        let request = information;
                        let data = JSON.parse(request.response)
                        let voucher_id = data.info.voucher_id;
    
                        console.log(voucher_id);
    

    【讨论】:

      猜你喜欢
      • 2019-07-30
      • 2019-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-15
      • 1970-01-01
      • 1970-01-01
      • 2012-08-03
      相关资源
      最近更新 更多