计算机与现代化

• 网络与通信 • 上一篇    下一篇

基于HTML5大文件断点续传的实现方案

  

  1. (河海大学计算机与信息学院,江苏 南京 211100)
  • 收稿日期:2015-12-10 出版日期:2016-03-17 发布日期:2016-03-17
  • 作者简介:王莉敏(1990-),女,河南商丘人,河海大学计算机与信息学院硕士研究生,研究方向:分布式系统; 梁正和(1963-),男,副教授,博士,研究方向:ERP,分布式系统; 段全锋(1990-),男,硕士研究生,研究方向:分布式系统。

Broken-point Continuingly-transferring Scheme of Large Files Based on HTML5

  1. (College of Computer and Information, Hohai University, Nanjing 211100, China)
  • Received:2015-12-10 Online:2016-03-17 Published:2016-03-17

摘要: 在Web应用中,文件上传是一个常用的功能,而目前的文件上传方式在处理大文件上传方面不尽人意,常常因为文件过大或者网络中断导致上传失败,不得不重新上传。随着HTML5相关技术的发展,出现了一系列对文件操作的API,如FileList、Blob、File、FileReader等接口,使得Web端能够使用JavaScript对本地文件进行分片操作进而实现文件断点续传功能。本文在此基础上解决了服务器端文件合并过程中用户等待超时问题以及如何保证合并文件正确性的问题。

关键词: 大文件上传, HTML5, File API, 断点续传, 文件合并

Abstract: In Web applications, it is often needed to upload a file to the server. With current file upload methods, it is difficult to deal with large file uploading and user experience is also bad. Uploading big files often failed because of network interruption and the client had to reupload. With the development of HTML5 technology, a series of API about file operation emerged. This makes it possible to use JavaScript on the client side to slice local files and further achieve the function of file broken-point continuingly-transferring. On this basis, this paper solves timeout problem of merging files and correctness problem of the final file on the server side.

Key words: large file uploading, HTML5, file API, broken-point continuingly-transferring, files merging

中图分类号: