S
S
SirotaKazansky2020-08-16 23:27:44
RESTful API
SirotaKazansky, 2020-08-16 23:27:44

How to implement upload of many files + json on FLASK?

I would like to send a request to the multipart server that includes JSON and an array of files.
You can describe the request like this:

requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                orderId:
                  type: integer
                userId:
                  type: integer
                filename:
                  type: array
                  items:
                    type: string
                    format: binary

What is the correct way to get multiple files using Flask? Maybe there is an example?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2020-08-16
@dimonchik2013

like with any other (except sockets) - in a loop one by one

V
Vadim Shatalov, 2020-08-17
@netpastor

https://wtforms.readthedocs.io/en/2.3.x/fields/#wt...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question