Giter Club home page Giter Club logo

blob-post's Introduction

Sample project to highlight an issue processing multipart-form uploads using zio-http

Sample project using scala 3 (3.4.2), zio 2 (2.1.2), zio-http (3.0.0-RC8) and other ancillary ZIO libraries that highlights a problem processing multipart-form data in streaming mode.

Collecting more fields

I am not sure we are using the best option to collect the different fields from the StreamingForm value. The solution we have identified kind of works, even if it feels pretty clanky. Any suggestion on how to do this differently is very welcome.

Processing ZStream data

Depending on how we process the incoming request though, we are getting different results.

/path

If we do consume the full streaming data right away from the ZStream[FormField], we get all the data correctly; this option is implemented in the /path handler. Unfortunately, this means we need to write all the data to a temporary file, and later re-read all the data to actually process its content.

/data

Another option is we keep the ZStream around until we have collected all the needed information, and later process it altogether. This option is implemented in the /data handler; it works file with "small" file uploads (up to ~7KB in size), but hangs with bigger uploads.

What are we doing wrong?

Any suggestion is very welcome

blob-post's People

Contributors

gcsolaroli avatar

Stargazers

Hartmut Pfarr avatar

Watchers

 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.