Coder Social home page Coder Social logo

tgkplvfy / uploader_html5_blob Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elvisxiao/uploader_html5_blob

0.0 2.0 0.0 22 KB

前端分段传输大文件组件,基于HTML5 File API、Blob,后端采用node接收文件

JavaScript 77.24% HTML 10.49% CSS 12.27%

uploader_html5_blob's Introduction

html5_file_uploader

基于前端的文件分片传输

A better way to send big file to server.

纯前端实现的大文件分片传输,使用file api,blob等,0依赖

###使用步骤 1、clone或者下载项目后,运行node server.js启动服务器

2、打开test.html, 选择文件即可上传(建议选择大文件已查看效果)

3、初始化:

var uploader = new Uploader({
	fileInput: 'iptFile',
	uploadUrl: 'http://localhost:3004/upload',
	// chunkSize: 100000
});

uploader.onUploadDone = function() {
	alert('上传完成');
};

uploader.onUploadBegin = function() {
	console.log('文件上传开始:', uploader.getFiles());
}

uploader.onUploading = function(percent) {
	console.log('已上传:' + percent + '%');
}

具体请参照:test.html

###开源策略 个人作品,可下载后随意更改,可用于任何途径

uploader_html5_blob's People

Contributors

elvisxiao avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.