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

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

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

        <bdo id='ea8EI'></bdo><ul id='ea8EI'></ul>
      <tfoot id='ea8EI'></tfoot>

        Dropzone.js 用 php 删除按钮

        Dropzone.js remove button with php(Dropzone.js 用 php 删除按钮)

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

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

          <tbody id='qCtss'></tbody>

        • <bdo id='qCtss'></bdo><ul id='qCtss'></ul>
          1. <tfoot id='qCtss'></tfoot>

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

                  本文介绍了Dropzone.js 用 php 删除按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我使用 dropzone.js 来制作一个不错的上传表单.我链接了 php 代码来上传文件,并设置了 addRemoveLinks=true 所以我有删除按钮.

                  I use dropzone.js for a nice upload form. I linked the php code to upload the files and i setted addRemoveLinks=true so i have the remove button.

                  我需要一个想法,当我点击删除按钮时,如何有效地删除使用 php 代码上传的文件.

                  I need an idea how to efectivly delete the filse uploaded with a php code when i hit remove button.

                  php 做起来很简单,但我不需要知道如何关联它们.我已经尝试在此函数中使用 $.post 删除文件:函数(文件)但没有成功.

                  The php is simple to do but i need t know how to relate them. I already tryed using $.post in this function removedfile: function(file) but no succes.

                    removedfile: function(file) {
                      $.post("test.php");
                      var _ref;
                      return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                  
                  },
                  

                  推荐答案

                  首先,你不应该简单地覆盖默认的 removedfile 事件处理程序,而应该注册你自己的处理程序.

                  First off, you shouldn't simply overwrite the default removedfile event handler, but rather register your own handler along with it.

                  您需要先从服务器取回 ID(这样您就知道如何关联它),然后使用它来设置删除调用.

                  You need to first get the ID back from the server (so you know how to relate to it) and then use this to setup the delete call.

                  Dropzone.options.myDropzone = {
                    init: function() {
                      this.on("success", function(file, response) {
                        file.serverId = response; // If you just return the ID when storing the file
                        // You can also return a JSON object then the line would
                        // look something like this:
                        //
                        // file.serverId = response.id;
                        //
                        // In that case make sure that you respond with the mime type
                        // application/json
                      });
                      this.on("removedfile", function(file) {
                        if (!file.serverId) { return; } // The file hasn't been uploaded
                        $.post("delete-file.php?id=" + file.serverId); // Send the file id along
                      });
                    }
                  

                  这篇关于Dropzone.js 用 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 的问题)

                    <tfoot id='holfp'></tfoot>
                      <tbody id='holfp'></tbody>
                        <bdo id='holfp'></bdo><ul id='holfp'></ul>
                      • <i id='holfp'><tr id='holfp'><dt id='holfp'><q id='holfp'><span id='holfp'><b id='holfp'><form id='holfp'><ins id='holfp'></ins><ul id='holfp'></ul><sub id='holfp'></sub></form><legend id='holfp'></legend><bdo id='holfp'><pre id='holfp'><center id='holfp'></center></pre></bdo></b><th id='holfp'></th></span></q></dt></tr></i><div id='holfp'><tfoot id='holfp'></tfoot><dl id='holfp'><fieldset id='holfp'></fieldset></dl></div>

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

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