精美的上载器-上载失败 [英] Fine Uploader -- Upload failed

查看:74
本文介绍了精美的上载器-上载失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Fine Uploader上传文件.我使用了网站上给出的示例:

I would like to upload a file using Fine Uploader. I used the example given at the website:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Fine Uploader Demo</title>
    <link href="fineuploader-3.5.0.css" rel="stylesheet">
  </head>
  <body>
    <div id="fine-uploader"></div>
    <script src="fineuploader-3.5.0.js"></script>
    <script>
       function createUploader() {
          var uploader = new qq.FineUploader({
             element: document.getElementById('fine-uploader'),
             request: {endpoint: 'test.php'}
          });
       }
       window.onload = createUploader;
    </script>
  </body>
</html>

显然,上传过程很好.但是,上传完成后,我收到了上传失败"消息.

Apparently the upload process was fine. However, when the uploading finished, I got the "Upload failed" message.

我认为我们需要另一个服务器端脚本来处理上载.服务器端脚本"test.php"如何接受上传?提供的任何示例代码将不胜感激.

I think we need another server-side script to handle the upload. How can the server-side script 'test.php' accept the upload? Any sample code provided will be appreciated.

对于Fine Uploader,上传文件的大小是否有上限?我尝试上传5GB的文件,但似乎无法正常工作.

Also, for Fine Uploader, is there an upper limit to the size of the file being uploaded? I tried uploading a 5GB file and it didn't seem to work.

最后,我们如何显示上传速度和剩余时间?

Lastly, how can we display the rate of upload as well as the time remaining?

推荐答案

@Deonia是正确的,我想添加评论,但显然没有足够的声誉...

@Deonia is right, and I would like to add a comment, but apparently don't have enough reputation...

服务器端存储库中有一个相当全面的PHP示例.

您会注意到 handleUpload 函数返回一个关联数组.这是来自服务器的指示成功的响应.请查看服务器端响应上的文档,以了解有效的方法.

You'll notice that the handleUpload function returns an associative array. This is the response from the server that indicates success. Check out the docs on server-side responses for ideas on what's valid.

本质上,除{ success: true }响应之外的任何内容都将导致Fine Uploader认为上传失败.

In essence, anything other than a { success: true } response will result in Fine Uploader thinking the upload failed.

这篇关于精美的上载器-上载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆