dongzouqie4220 2019-03-15 19:29
浏览 42

Dropzone Code无效 - 未提交$ FILE参数

My code is the following: The dropzone page works, but when SUBMIT is executed, the file is not transfered to my php script. the Param $_FILE['wordfile']is always empty. Any idea why? I tried several differen ways...no idea. I gave up now :-(

<div id="dropzone" style="margin: 20px auto;width: 400px;">
    <form name="form1"  method="post" ENCTYPE="multipart/form-data" action="upload.php" class="dropzone" id="form1">
    <input type="hidden" name="id_dok" value="79746">
    <input type="hidden" name="sender" value="2">
    <input type="hidden" name="seite" value="2">
    <input type="hidden" name="min_woerter" value="350">
    <input type="hidden" name="min_woerter_docx" value="350">
    <div class="dz-message needsclick">
    Datei hier ablegen oder klicken.<br>
    <span class="note needsclick">Erlaubt sind: <strong>docx, doc, rtf, page, wps, pptx</strong>
    <br>Anforderung: <strong>800 Worte</strong></span>
  </div>

    </form>
</div>

<script src="includes/dropzone/dropzone.js"></script>  
<script type="text/javascript">  

Dropzone.autoDiscover = false;
        window.onload = function () {

            var dropzoneOptions = {
                dictDefaultMessage: 'Hier ablegen!',
                paramName: "wordfile",
                uploadMultiple : false,
                acceptedFiles: ".doc,.docx",
                maxFiles : 1,                
                maxFilesize: 1, // MB

                addRemoveLinks: false,
                init: function () 
                {   this.options.dictRemoveFile = "Entfernen";
                    this.on("success", function (file) 
                    {   console.log("juhu");

                    });
                     this.on("complete", function (file) {
                      if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
                        document.getElementById("form1").submit();

                      }
                    });
                }
            };
            var uploader = document.querySelector('#form1');
            var newDropzone = new Dropzone(uploader, dropzoneOptions);
        };
</script>

Thanks Bo

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 求数学坐标画圆以及直线的算法
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 自己瞎改改,结果现在又运行不了了
    • ¥15 链式存储应该如何解决
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站