Giter Site home page Giter Site logo

upload_file's People

Contributors

zhouqiang-cl avatar n0vad3v avatar

Stargazers

Shawn Charles avatar FCP avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

pschakravarthi

upload_file's Issues

Support multi upload

When multi upload happends, there may some errors like

[2020-12-01T08:38:56.204Z] + curl --output /dev/null --silent --head --fail http://fileserver.pingcap.net/download/builds/pingcap/tidb/pr/6ee15bf75a0b132a5aee15eb79d6092abe39b04a/centos7/done
[2020-12-01T08:38:56.204Z] + curl http://fileserver.pingcap.net/download/builds/pingcap/tidb/pr/6ee15bf75a0b132a5aee15eb79d6092abe39b04a/centos7/tidb-server.tar.gz
[2020-12-01T08:38:56.204Z] + tar xz -C ./tidb-src
[2020-12-01T08:38:56.204Z]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[2020-12-01T08:38:56.204Z]                                  Dload  Upload   Total   Spent    Left  Speed
[2020-12-01T08:38:57.850Z] 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  3 80.9M    3 2796k    0     0  23.5M      0  0:00:03 --:--:--  0:00:03 23.3M
 44 80.9M   44 35.8M    0     0  32.0M      0  0:00:02  0:00:01  0:00:01 32.0M
 74 80.9M   74 60.6M    0     0  30.9M      0  0:00:02  0:00:01  0:00:01 30.9M
[2020-12-01T08:38:57.851Z] curl: (18) transfer closed with 21234364 bytes remaining to read
[2020-12-01T08:38:57.851Z] 
[2020-12-01T08:38:57.851Z] gzip: stdin: unexpected end of file
[2020-12-01T08:38:57.851Z] tar: Unexpected EOF in archive
[2020-12-01T08:38:57.851Z] tar: Unexpected EOF in archive
[2020-12-01T08:38:57.851Z] tar: Error is not recoverable: exiting now

I think there are two approaches to achieve this

  1. First upload to a tmp dir, when upload finished, mv it to a dest dir
  2. Check if the file exists, if exists, return a file exist code

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.