您好,我在使用 Dropzone.js 中的自定义选项时遇到问题。即使我将其设置为 true,它也不会显示删除链接。我不确定我是否正在处理这个错误或到底发生了什么。文件正在正确上传,并且显示加载栏和已完成的复选标记。
我目前的代码是:
<html>
<head>
<!-- 1 -->
<link href="models/site-templates/dropzone.css" type="text/css" rel="stylesheet" />
<!-- 2 -->
<script src="models/dropzone.js">
Dropzone.options.myDropzone = {
addRemoveLinks: true,
};
</script>
</head>
<body>
<!-- 3 -->
<form id="myDropzone" action="upload.php" class="dropzone"></form>
</body>
</html>
这是upload.php
<?php
$ds = "/"; //1
$storeFolder = 'uploads'; //2
if (!empty($_FILES)) {
$tempFile = $_FILES['file']['tmp_name']; //3
$targetPath = dirname( __FILE__ ) . $ds. $storeFolder . $ds . "temp" . $ds; //4
$targetFile = $targetPath. $_FILES['file']['name']; //5
move_uploaded_file($tempFile,$targetFile); //6
}
?>