0

I'm using Delphi 10.4.2 and use TIdHTTPServer to receive data.

The client want to attach one or more an image files with this data. Something like this:

POST Multipart/form-data: 

Data fields:

"sharakrak_id":1852,
"event_id":1629630415,
"event_type":1,
"client_id":1852,
"cam_id":2,
"objects":["person"]

Attached files:
"image" - image files (0, 1 or more)

How I can determine that there are files attached and save all of them?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 2
    While `TIdHTTPServer` can *receive* a `multipart/form-data` post, it will not *parse* the data for you (see https://github.com/IndySockets/Indy/issues/138), so you will have to parse the contents of `ARequestInfo.PostStream` yourself manually, such as by using `TIdMessageDecoderMIME` (see https://stackoverflow.com/questions/27257577/). – Remy Lebeau Feb 09 '22 at 19:14
  • Thanks TIdMessageDecoderMIME help me . Hope the Indy will add this to the component. – Shraga Milon Feb 10 '22 at 12:07

0 Answers0