我刚买了fine-uploader,但我不能让它工作。我想在没有 s3 的情况下将它与 xampp 和 php 一起使用。
这是 index.php:
<html>
<head>
<link href="fineuploader-3.8.2.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="fine-uploader">
</div>
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="jquery.fineuploader-3.8.2.min.js" type="text/javascript"></script>
<script>
// Wait until the DOM is 'ready'
$(document).ready(function () {
$("#fine-uploader").fineUploader({
debug: true,
request: {
endpoint: 'php.php'
},
retry: {
enableAuto: true
}
});
});
</script>
</body>
</html>
然后来自服务器存储库的 php.php:
<?php
// list of valid extensions, ex. array("jpeg", "xml", "bmp")
$allowedExtensions = array();
// max file size in bytes
$sizeLimit = 10 * 1024 * 1024;
//require('fine-uploader/server/php.php');
$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
// Call handleUpload() with the name of the folder, relative to PHP's getcwd()
$result = $uploader->handleUpload('uploads/');
// to pass data through iframe you will need to encode all html tags
echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);
/**
* Handle file uploads via XMLHttpRequest
*/
class qqUploadedFileXhr {
...
上传文件夹存在并且是可写的(因为我在本地工作)。所以有什么问题?我是否需要 qqFileUploader.php,它也在存储库中?
任何人都可以提供一个使用php的工作示例吗?
非常感谢和亲切的问候
网路