Giter VIP home page Giter VIP logo

upload-demo's Introduction

upload-demo (include download)

Uploading a large file by fragmentation, powered by Flask and WebUploader. Downloading the file through streaming.

目的

  • 前端采用分片方式上传大文件给后端,后端接收全部分片后,将其组合成一个文件

  • 支持多用户同时上传,互不干扰

  • 支持流式下载文件,低占用内存

安装

  • 通过pip install -r requirements安装所需包

运行

  • 命令行键入“./server.py runserver”启动服务器

  • 浏览器访问“127.0.0.1:5000 ”,点击“请选择”按钮,选择文件并上传

  • 浏览器访问“127.0.0.1:5000/file/list ”,点击一个上传的文件进行下载

效果

  • 文件上传成功

  • 文件上传失败

技术

未来

  • 将上传的分片组合成新文件时,需将分片内容全部读出,会造成内存紧张。可以考虑不合并分片,下载时直接按序读取并回传

  • demo中使用了三种开源框架,后续修改应注意遵守BSD与MIT协议,感谢

致谢

  • 提供开源框架的母公司

  • hulkbai 解决因编码造成的合并分片失败

  • CharlieLio 报告文件名乱码问题

upload-demo's People

Contributors

jinixin avatar

Watchers

James Cloos avatar Numberwolf-Yanlong 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.