Giter Site home page Giter Site logo

Comments (2)

rileytomasek avatar rileytomasek commented on May 20, 2024

I'm not 100% sure, but I don't think Zodix will work with files because it uses the URLSearchParams trick to parse the FormData. The code is here: https://github.com/rileytomasek/zodix/blob/master/src/parsers.ts#L172

If you can think of a simple way to add support, I'd be open to a PR, otherwise you may have to get the file from the FormData separately and handle validation directly with Zod.

from zodix.

mdoury avatar mdoury commented on May 20, 2024

Ok, thanks! I was wondering whether I was doing something wrong 😅

The URLSearchParams trick indeed explains the "[object File]" string in the console output as explained on the UrlSearchParams MDN page :

A literal sequence of name-value string pairs, or any object — such as a FormData object — with an iterator that produces a sequence of string pairs. Note that File entries will be serialized as [object File] rather than as their filename (as they would in an application/x-www-form-urlencoded form).

I will look into it and let you know if I find a way to make it work without adding too much overhead.

from zodix.

Related Issues (19)

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.