Help for this page

Select Code to Download


  1. or download this
    # Limit file sizes to 1 MB
    use constant MAX_FILE_SIZE => 1_048_576;
    $CGI::POST_MAX = MAX_FILE_SIZE;
    
  2. or download this
    # 100 MB limit on the size of the upload dir
    use constant MAX_DIR_SIZE => 100 * 1_048_576;
    ...
    
    die 'Upload directory is full.'
      if ( dir_size('/path/to/dir') + $ENV{CONTENT_LENGTH} > MAX_DIR_SIZE 
    +);