Give us contact

Do you prefer to ask us directly?

Call us +420 605 203 938 (the Czech Republic)

or use this contacts

Server configuration for large files

Related links


Framework Core functionality
FI - Finance Management

Server settings for large files management

With NGINX / PHP in the backyard there are serveral places where large files shall be allowed

NGINX settings

NGINX has configuration file for each domain something like
etc/ngxinx/site-enabled/yourdomain.conf.

For large file uploads there should be something like:
client_max_body_size 400M;
with size set according to the maximal limit allowed for clients

PHP settings

PHP (recommendation for PHP 8.6, PHP 9) must allow large file in the ini file:
post_max_size = 400M.

AyMINE setting

Hard back-end system settings

AyMINE configuration in the fSettings class stores several important configuration constants. (In theory they might be client-dependent but there is no reason for that.)

class fSettings {

  // Relevant to Ay version 6

  /** Size of the file exceding limits for processing by app */
  public const int largeFileLimit = 30000000;
  /** Maximal size that is allowed to be stored in the system */
  const limSize = 400000000; // 400MB

  /** Maximal allowed file size limit for user
   * @param int|null $sysClientID = null - optional client identification; 
   * if not defined session value or non-client settings is returned
   */
  public static function maxFileSize(int|null $sysClientID = null): int
  {
    return fSettings::largeFileLimit;   // 30MB limit - controlled both by client and server
  }

  /** Maximal allowed file size limit for user
   * @param int|null $sysClientID = null - optional client identification; 
   * if not defined session value or non-client settings is returned
   */
  public static function maxImageSize(int|null $sysClientID = null): int
  {
    return 20000000;   // 20MB limit for images - controlled only by client
  }
} 

Files larger than largeFileLimit are not managed by in-memory operations. The limit is the same for backEnd and application so that large files are not encrypted

Files larger that limSize are directly rejected and cannot by uploaded to the system,

Client-based settings

Each client has maximal file size limit defined in the client's settings (see client configuration in the administration console). Files larger than limit are rejected. Client-related Limit is controlled both by user's application as well as by server. Application reject large size even before pushing them to the server.

Default settings for client's is between 5 – 30M. Larger files must be manually configured upon request enabled.