weixin_33693070 2014-09-04 13:03 采纳率: 0%
浏览 38

HTML5 Ajax上传-是否可降解?

I'm looking at this technique of uploading a file using Ajax:

http://www.sitepoint.com/html5-javascript-file-upload-progress-bar/

I have two questions about it.

  1. It seems to work on my computer using IE9. I was under the impression that it requires IE10+ according to caniuse: http://caniuse.com/#feat=fileapi

  2. What happens to a users computer who doesn't have an up-to-date browser, will it work like a traditional upload field in IE6 for example?

  • 写回答

1条回答 默认 最新

  • weixin_33690367 2014-09-04 14:53
    关注

    You can upload files with Ajax without Html5 and you don't need the File Api to do that either. The progress event however is a feature of the XMLHTTPRequest v2, so you'll have to handle that differently for older unsupporting browsers or not show progress at all :)

    Alternatively you could write your own upload handler that would report how much of the file has been sent, and then just probe it every x seconds to ask how far it has come. I think Telerik does this with their controls for ASP.NET and MVC.

    评论

报告相同问题?