Execute middleware before receiving uploaded file

Good morning. Hello,

I use middleware to manage authentication. Everything works fine, except for file uploads.

In fact, the uploaded files are sent to the server before the request is implemented. it is then easy to overload my server by sending several large files.

How to deal with this problem?

With kind regards

You cannot; This is a design flaw in PHP.

Ok, thanks you @geggleto