I
I
Ivan2016-12-26 12:34:36
JavaScript
Ivan, 2016-12-26 12:34:36

The format in which data is transmitted from input[type="file"]?

Good afternoon.
In what form the form gives the files that were attached to it. And is it possible to make a picture in the same format without using forms using php?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Semenko, 2016-12-26
@Shucach

HTML forms usually use multipart/form-data, you can read about this encoding. In PHP, this is done using CURL or some library from the list (I only checked some of them), in any case, the same multipart encoding will be used.
PS The image itself is not encoded in any way, it is simply written to a string that is transmitted to the server, and multipart is used to separate data and indicate additional values ​​​​(type, file name, etc.) (probably this is a bad wording, but the essence should be clear) .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question