我正在尝试创建一个div,可以在其中放置文件并将其保存到我的Web服务中。我尝试使用this tutorial之后的dropzone来做! ,但这在这方面让我不满意。我正在使用asp.net框架。
我尝试过大写和小写.dropzone(),并将版本降低到版本4.0.4
这是我的观点
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.0.1/dropzone.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.0.1/dropzone.js"></script> <div id="dZUpload" class="dropzone"> <div class="dz-default dz-message"> Drop image here. </div> </div> <script type="text/javascript"> $(document).ready(function () { //Simple Dropzonejs $("#dZUpload").Dropzone({ url: "Home/DropzoneFileUpload.cshtml", addRemoveLinks: true, success: function (file, response) { var imgName = response; file.previewElement.classList.add("dz-success"); console.log("Successfully uploaded :" + imgName); }, error: function (file, response) { file.previewElement.classList.add("dz-error"); } }); }); </script>