Giter VIP home page Giter VIP logo

Comments (5)

jaredwolff avatar jaredwolff commented on September 28, 2024

My workaround for now is to read the whole file into memory and use put_object_blocking. Not ideal but I'm not working with big files.

      // Open the file
      let mut file = File::open(path).expect("Unable to open file!");

      let mut buffer = Vec::new();
      // read the whole file
      file
        .read_to_end(&mut buffer)
        .expect("Unable to read to end");

      // Upload file to AWS
      let (_, status_code) = bucket
        .put_object_blocking(&server_filename, &buffer, "application/octet-stream")
        .unwrap_or_else(|e| {
          error!("Unable to upload {}! Error: {}", &server_filename, e);
          std::process::exit(1);
        });

from rust-s3.

durch avatar durch commented on September 28, 2024

@jaredwolff thank you for raising the issue, I'll look into it ASAP

from rust-s3.

jiangplus avatar jiangplus commented on September 28, 2024

I came into the same issue too.
The put_object_stream_blocking just uploaded an empty file, discarding the content.

from rust-s3.

durch avatar durch commented on September 28, 2024

@jaredwolff, @jiangplus version 0.23 released today fixes this

from rust-s3.

Qwertie- avatar Qwertie- commented on September 28, 2024

This is very likely not the same issue but I had a problem with the same result. Problem was I needed to reset the pointer for the file with file.seek(SeekFrom::Start(0)).await?; before uploading.

from rust-s3.

Related Issues (20)

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.