【发布时间】:2020-01-13 06:30:48
【问题描述】:
我有一个嵌入了 dropzone.js 的 laravel 应用程序。
上传成功,
我一直在尝试做的是使用ajax删除dropzone中上传的文件。
在 dropzone 预览窗格中Remove file。
我的刀片文件。
<div class="dropzone" id="dropzoneFileUpload">
<label for="file" class="control-label text-center">Choose a file</label>
<span class="control-fileupload">
<img src="{{URL::asset('/images/image_upload.svg')}}" width="50px" class="upload-icon">
</span>
</div>
<script type="text/javascript">
var baseUrl = "{{ url('/') }}";
var token = "{{ csrf_token() }}";
var documentType = $("#RC").val();
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone("div#dropzoneFileUpload", {
url: baseUrl + "/dropzone/uploadRC",
params: {
_token: token,
documentType: documentType
},
success:function(file, response)
{
//$('#documentType1').val(response['documentType']);
doctype = doctype.concat(response['documentType']);
$("#documentType").val(doctype);
doc = doc.concat(response['doc']);
$("#document").val(doc);
alert(doctype);
}
</script>
我的问题是:如何删除 dropzone 中上传的文件? 我在 dropzone 中没有看到任何选项作为 ajax。
【问题讨论】:
-
请阅读这篇文章,我认为它会对您有所帮助:devnote.in/…
标签: php laravel dropzone.js dropzone