Giter Site home page Giter Site logo

s3upload's Introduction

#S3 ManagedUpload

Start

git clone https://github.com/leonli/S3Upload
npm install & npm start

S3桶的CROS配置

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>DELETE</AllowedMethod>
    <ExposeHeader>ETag</ExposeHeader>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

参数说明

var upload = s3.upload(params, {
        queueSize: 1, // 分片上传并发队列,代表了能同时上传的分片数量
        connectTimeout:60 * 1000 * 10, // 连接timeout时间
        httpOptions: {
            timeout: 60 * 1000 * 10 // 10 minutes
        }})

测试结果:

a. 上传一个16M的文件,将会分为4片上传, 5M + 5M + 5M + 1M; b. 当Part1和Part2片上传后,断网,再重新连网,上传将会自动恢复,并且开始从第3片Part3开始上传,直到最后上传完成.

PS

断点续传是由切片上传完成的,默认切片5M,最小切片5M, 所以续传单位是5M.

s3upload's People

Contributors

leonli avatar

Stargazers

 avatar

Watchers

James Cloos 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.