Execute middleware before receiving uploaded file


#1

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


#2

You cannot; This is a design flaw in PHP.


#3

Ok, thanks you @geggleto