我在使用Fine Uploader库时遇到了一些错误,无法找出原因。
这里发生了什么。这是我在我的网页上使用的代码:
var uploader = new qq.s3.FineUploader({
element: document.getElementById("fineUploader"),
request: {
endpoint: "mybucket.amazonaws.com",
accessKey: "ABCDEFGHIJKLMNOPQRS"
},
signature: {
endpoint: "/wp-content/themes/zone/vendor/fineuploader/php-s3-server/endpoint.php"
},
uploadSuccess: {
endpoint: "/wp-content/themes/zone/vendor/fineuploader/php-s3-server/endpoint.php?success"
},
objectProperties: {
key: "filename"
},
iframeSupport: {
localBlankPagePath: "/wp-content/themes/zone/success.html"
},
cors: {
expected: true
},
chunking: {
enabled: true
},
resume: {
enabled: true
},
});
此代码正在将文件上传到S3,但我在页面上收到错误:
在上传者的界面中,我收到一条错误消息,指出"上传失败"在红色框中。
在开发者控制台中,我得到:
POST http://comain.dev/wp-content/themes/zone/vendor/fineuploader/php-s3-server/endpoint.php?success 500 (Internal Server Error)sendRequest @ s3.fine-uploader.js:3936prepareToSend @ s3.fine-uploader.js:4055send @ s3.fine-uploader.js:4106qq.extend.sendSuccessRequest @ s3.fine-uploader.js:9042(anonymous function) @ s3.fine-uploader.js:8184(anonymous function) @ s3.fine-uploader.js:702qq.nonTraditionalBasePrivateApi._onComplete @ s3.fine-uploader.js:8188qq.uiPrivateApi._onComplete @ s3.fine-uploader.js:6107options.onComplete @ s3.fine-uploader.js:2266upload.cleanup @ s3.fine-uploader.js:4566(anonymous function) @ s3.fine-uploader.js:4540(anonymous function) @ s3.fine-uploader.js:1126qq.each @ s3.fine-uploader.js:665qq.extend.success @ s3.fine-uploader.js:1125(anonymous function) @ s3.fine-uploader.js:1126qq.each @ s3.fine-uploader.js:665qq.extend.success @ s3.fine-uploader.js:1125(anonymous function) @ s3.fine-uploader.js:1126qq.each @ s3.fine-uploader.js:665qq.extend.success @ s3.fine-uploader.js:1125xhr.onreadystatechange @ s3.fine-uploader.js:10063
s3.fine-uploader.js:256 [Fine Uploader 5.3.2] POST request for 0 has failed - response code 500qq.log @ s3.fine-uploader.js:256qq.basePublicApi.log @ s3.fine-uploader.js:1844(anonymous function) @ s3.fine-uploader.js:702onComplete @ s3.fine-uploader.js:3862(anonymous function) @ s3.fine-uploader.js:3970
s3.fine-uploader.js:256 [Fine Uploader 5.3.2] Your server indicated failure in its upload success request response for id 0!
文件上传有什么奇怪之处。通过检查桶确认了这一点。看起来好像uploadSuccess:函数有一些错误。我在本地使用MAMP Pro以防万一。
任何想法可能会发生什么?谢谢!
答案 0 :(得分:1)
500错误来自您的签名端点,并且当您的服务器尝试处理Fine Uploader POST“成功”请求时发生这种情况,这表示该文件安全地存在于S3中。附加到该端点服务器端的代码以某种方式失败。您需要检查服务器日志以确定特定故障是什么。也许您尝试在此调用中调用S3服务器端,并且关联的IAM用户没有适当的权限。可能是这个,或者是其他任何问题。