<bdo id='NWKmA'></bdo><ul id='NWKmA'></ul>

    <legend id='NWKmA'><style id='NWKmA'><dir id='NWKmA'><q id='NWKmA'></q></dir></style></legend>

    1. <small id='NWKmA'></small><noframes id='NWKmA'>

    2. <i id='NWKmA'><tr id='NWKmA'><dt id='NWKmA'><q id='NWKmA'><span id='NWKmA'><b id='NWKmA'><form id='NWKmA'><ins id='NWKmA'></ins><ul id='NWKmA'></ul><sub id='NWKmA'></sub></form><legend id='NWKmA'></legend><bdo id='NWKmA'><pre id='NWKmA'><center id='NWKmA'></center></pre></bdo></b><th id='NWKmA'></th></span></q></dt></tr></i><div id='NWKmA'><tfoot id='NWKmA'></tfoot><dl id='NWKmA'><fieldset id='NWKmA'></fieldset></dl></div>
    3. <tfoot id='NWKmA'></tfoot>

      Blueimp jQuery 文件上传插件——“空文件上传"结果 PHP

      Blueimp jQuery File Upload plugin - quot;Empty file uploadquot; result PHP(Blueimp jQuery 文件上传插件——“空文件上传结果 PHP)
        <tbody id='Pq9Zo'></tbody>

    4. <i id='Pq9Zo'><tr id='Pq9Zo'><dt id='Pq9Zo'><q id='Pq9Zo'><span id='Pq9Zo'><b id='Pq9Zo'><form id='Pq9Zo'><ins id='Pq9Zo'></ins><ul id='Pq9Zo'></ul><sub id='Pq9Zo'></sub></form><legend id='Pq9Zo'></legend><bdo id='Pq9Zo'><pre id='Pq9Zo'><center id='Pq9Zo'></center></pre></bdo></b><th id='Pq9Zo'></th></span></q></dt></tr></i><div id='Pq9Zo'><tfoot id='Pq9Zo'></tfoot><dl id='Pq9Zo'><fieldset id='Pq9Zo'></fieldset></dl></div>
          <bdo id='Pq9Zo'></bdo><ul id='Pq9Zo'></ul>
          <tfoot id='Pq9Zo'></tfoot>
              1. <legend id='Pq9Zo'><style id='Pq9Zo'><dir id='Pq9Zo'><q id='Pq9Zo'></q></dir></style></legend>

              2. <small id='Pq9Zo'></small><noframes id='Pq9Zo'>

                本文介绍了Blueimp jQuery 文件上传插件——“空文件上传"结果 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                这是插件:https://github.com/blueimp/jQuery-File-Uploadp>

                上传文件后,我无法从插件获取我想要的响应.

                在带有插件的页面上,我有以下内容

                $('#fileupload').fileupload('选项',{'maxNumberOfFiles' :1,网址":/admin/upload_handler.php"});

                upload_handler.php 中,我成功地从 $_FILES 检索上传的文件并执行操作,然后以 JSON 格式发回响应.我已使用 Firebug 确认响应格式正确:

                <代码>[{url":image_url",thumbnail_url":image_th_url",delete_url":测试",删除类型":删除",名称":foobar.jpg",尺寸":7419}]

                但是回调找不到文件数组,我得到错误:'空文件上传结果'.我觉得我在这里遗漏了一些重要的东西——我在文档、论坛或 Stack Overflow 中找不到任何东西.感谢您的帮助.

                解决方案

                从插件版本5开始,json响应发生了变化:https://github.com/blueimp/jQuery-File-Upload/wiki/JSON-Response

                所以你只需要调整你的上传类:

                $filejson = new stdClass();$filejson->files[] = $fileArray;返回 json_encode($filejson);

                你已经完成了

                Here's the plugin: https://github.com/blueimp/jQuery-File-Upload

                I'm having a problem getting the response I want from the plugin after uploading a file.

                On the page with the plugin, I have the following

                $('#fileupload').fileupload(
                    'option',
                    {
                        'maxNumberOfFiles' :1,
                        'url' : '/admin/upload_handler.php'
                    }
                );
                

                In upload_handler.php I successfully retrieve the uploaded files from $_FILES and do stuff, then send a response back in JSON. I've confirmed using Firebug that the response is in the proper format:

                [ 
                    {                
                        "url" : "image_url",
                        "thumbnail_url" : "image_th_url",
                         "delete_url" : "test",
                         "delete_type" : "DELETE",
                         "name" : "foobar.jpg",
                         "size" : 7419
                     }
                ]
                

                But the callback can't find the files array, and I get the error: 'Empty file upload result'. I feel like I'm missing something crucial here--I can't find anything in the docs, forums, or Stack Overflow. I appreciate any help.

                解决方案

                Since the version 5 of the plugin, the json response has changed: https://github.com/blueimp/jQuery-File-Upload/wiki/JSON-Response

                So you just have tweak your upload class with:

                $filejson = new stdClass();
                $filejson->files[] = $fileArray;
                return json_encode($filejson);
                

                And you're done

                这篇关于Blueimp jQuery 文件上传插件——“空文件上传"结果 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                <i id='QVWB2'><tr id='QVWB2'><dt id='QVWB2'><q id='QVWB2'><span id='QVWB2'><b id='QVWB2'><form id='QVWB2'><ins id='QVWB2'></ins><ul id='QVWB2'></ul><sub id='QVWB2'></sub></form><legend id='QVWB2'></legend><bdo id='QVWB2'><pre id='QVWB2'><center id='QVWB2'></center></pre></bdo></b><th id='QVWB2'></th></span></q></dt></tr></i><div id='QVWB2'><tfoot id='QVWB2'></tfoot><dl id='QVWB2'><fieldset id='QVWB2'></fieldset></dl></div>
              3. <tfoot id='QVWB2'></tfoot>

                    <tbody id='QVWB2'></tbody>
                      <bdo id='QVWB2'></bdo><ul id='QVWB2'></ul>

                          <small id='QVWB2'></small><noframes id='QVWB2'>

                          <legend id='QVWB2'><style id='QVWB2'><dir id='QVWB2'><q id='QVWB2'></q></dir></style></legend>