Hello!

It is possible to upload files to the server in 2 ways:

  1. PHP $_FILE[]
  2. Nginx module upload

In terms of efficiency and speed when uploading files to the server, which option to choose?

Considering that the frontend is NGINX and the backend of Apache.

  • From the description you use PHP then $ _FILE. - Artem
  • I'm not using anything yet. I want to find out more correctly to do it at the level of nginx or php. I tend to nginx more. But I would like to hear the opinion of a professional, if possible. - Sever

1 answer 1

Nginx upload module will be more efficient, since the body of the POST request will be immediately written to a temporary file and only the path to the file will be transferred to the backend. While for the standard PHP mechanism, you will need to proxy the body of the POST request entirely on the backend with all the ensuing consequences and limitations.

  • Thank you very much. I was expecting that kind of explanation. - Sever