我正在构建一个dropzone用于上传文件的表单。我可以轻松上传文件。我还添加了一个选项来删除上传的文件,addRemoveLinks: true但它仅删除预览窗格中的文件,而不删除存储文件的服务器中的文件。有没有办法在 dropzone 中编写手动 ajax 请求以删除 dropzone 中上传的文件?我的刀片文件包含 dropzone 。<div class="col-md-3 text-center"> <label class="checkbox-inline"><input type="checkbox" name = "RC" id = "RC" value="RC">RC</label> <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> <div class="deleteRC" id = "deleteRC"> <button type ="button" class="btn btn-danger" style="cursor:'pointer';" onclick = "Deleteimg();" data-toggle="tooltip" data-placement="top" title="Delete"><span class="glyphicon glyphicon-trash"></span></button> </div> </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/uploadImage", addRemoveLinks: true, params: { _token: token, documentType: documentType }, success:function(file, response) { doctype = doctype.concat(response['documentType']); $("#documentType").val(doctype); doc = doc.concat(response['doc']); $("#document").val(doc); alert("Upload completed");</script>
添加回答
举报
0/150
提交
取消