Home > database >  Upload any type of file to the server
Upload any type of file to the server

Time:07-09

How can I upload a file to the server without space limit? I want to find out the code sequence in HTML and Javascript / PHP. I only use NGINX. Can there be a setting in NGINX that limits my upload (if so, how to disable it)?

CodePudding user response:

client_max_body_size

NGINX has a setting that can limit the upload size of files. In your NGINX configuration, you can use client_max_body_size to set the max body size of incoming requests. Setting it to 0 disables it.

server {
    client_max_body_size 0;
}

There is more information available here: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

CodePudding user response:

Disabling a web server upload limit is a bad idea - it would mean anyone can take your website down with a single line of code mimicking uploading a billion terabyte file. You can however adjust the upload size in your php.ini file under upload_max_filesize. You can also change the client_max_body_size entry in your nginx.conf.

  • Related