Giter Site home page Giter Site logo

mlhpdx / s3-upload-stream Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 7.0 24 KB

Code library that provides a Stream implementation that makes working with uploads to S3 easier where the size of the content isn't known a priori. It holds only partial content in memory (works with large objects), and is compatible with code libraries that work with output streams.

License: MIT License

C# 100.00%
s3 streams content-length upload multi-part dotnet-core

s3-upload-stream's People

Contributors

diegojancic avatar lee-11 avatar mlhpdx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

s3-upload-stream's Issues

Write zero-length files.

Thank you for the example code. Wrapping the AWS SDK S3 Multipart Upload in a stream is quite useful.

However, in my use case, my inputs are compressed files that I must expand and write to S3. Sometimes the compressed file is empty (zero-length), other times it holds files over a gigabyte in size, usually the files are a few megabytes, but the content varies widely.

Can this be easily modified to write zero-length files to S3?

In my own debugging, it looks like the .Net 6 framework is calling the Write method on a separate thread, with only framework code in the call stack. And then, only if there is content to write - I guess a file header with no content doesn't pass the test.

Question about part length

Hi,

Thanks a lot for the example, this solved me a big issue.
I just have a question regarding the calculation of the part length in StartNewPart method:
_metadata.PartLength = Math.Min(MAX_PART_LENGTH, Math.Max(_metadata.PartLength, (_metadata.PartCount / 2 + 1) * MIN_PART_LENGTH));

_metadata.PartLength = Math.Min(MAX_PART_LENGTH, Math.Max(_metadata.PartLength, (_metadata.PartCount / 2 + 1) * MIN_PART_LENGTH));

What is the logic behind _metadata.PartCount / 2 + 1?

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.