maxfileuploads with the /go/maxfileuploads Command

/go/maxfileuploads sets PHP's max_file_uploads (the maximum number of files a visitor can send in a single upload request) in the php.ini file of every installed PHP version at once. It: PHP ignores files beyond the limit in a single request. The limit applies to the number of files, not their size. For size limits, see uploadmaxfilesize and postmaxsize. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Set the default (100 files per request) in every php.ini
/go/maxfileuploads

The new value is live about a minute later.

Options

This command has no options. It takes one optional argument.

Argument Required Default Notes
<number> No 100 A whole number of files. Nothing checks the value (see Validation).
return No — Prints the current value instead of setting one.

Examples

# Use the default of 100 files
/go/maxfileuploads

# Allow up to 50 files per request
/go/maxfileuploads 50

# Show the current value
/go/maxfileuploads return

# Apply the change immediately instead of waiting for the scheduled reload
/go/maxfileuploads 50 && /go/fpm

Output

Outcome What you get
Value set Max File Uploads updated successfully.
return The number from the first php.ini found. Blank if that file has no max_file_uploads line.
Unsupported operating system Unknown operating system. Nothing is changed.

The success message is printed even if no php.ini file was found, so it does not prove that anything changed. Check with return.

The scheduled reload prints nothing. Every run is also recorded in /var/log/go/maxfileuploads.log.

[!NOTE]
return ends with exit status 1, and return does not schedule a reload. In scripts, read the output instead of relying on the exit status.

See the full reference at /go/maxfileuploads and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *