N
N
Nadim Zakirov2021-06-17 14:43:41
PHP
Nadim Zakirov, 2021-06-17 14:43:41

How to get request body using php://input with multipart/form-data request type?

Much to my regret, the php://input stream outputs a void:

$body  = file_get_contents('php://input'); // Не выдает ничего, хотя я отправляю НЕ пустую форму

In the documentation, I found a note that when the content type is multipart/form-data , the php://input stream is automatically cleared. Can't anything be done here? I need the entire request body in the form in which it was received.

I would be grateful if someone could suggest a solution.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
none7, 2021-06-17
@zkrvndm

php.ini
enable_post_data_reading = Off
In this case, of course, the $_POST variable will not be created and this must be taken into account.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question