Add a Size Limit in Kb or Mb for attachments

HivePress - New Features

To save up storage on the hard disk, a Size Limit in Kb or Mb could be added to the (File) Attachment Attribute/Field type.

Thank you

Hi @Chris041973,

I think this would require a custom implementation as I don’t believe this feature is currently built into HivePress. However, as a workaround, you could use a third-party plugin like Imagify which can greatly reduce the file sizes and optimise them for speed upon upload.

You may also find these links useful:

  1. How to customize the image sizes - HivePress Help Center

  2. How to Increase the Max Upload Size in WordPress

I hope this helps!

Cheers,
Chris :victory_hand:

1 Like

Thank you for the WordPress Tutorial … Now, we can limit the upload size of Media files from the front-end …

How to Increase the Max Upload Size in WordPress

There are multiple methods to update the file size limit and we used the php.ini file …

Step 1 : Update php.ini file

  1. Edit the php.ini file
  2. Replace the setting 'upload_max_filesize = 32M by 'upload_max_filesize = 1M
  3. Save the php.ini file
  4. Stop and restart the server

Step 2 : Test the File Upload from the front-end with ‘Attachment’ Attribute/Field

  1. When we try to upload a PDF file above 1MB, the warning message below is shown
  2. Warning Message : ‘‘The uploaded file exceeds the upload_max_filesize directive in php.ini.’’

Please do you know what is the file where is written this Warning Message ??

because we would like to update this Warning message by :
Warning Message : ‘‘Maximum Upload Size is 1MB’’

Thank you …

Sorry, no need to update the ‘Warning Message’

We are going to update the Title of the ‘Attachment’ Field like below

PDF File (1MB max.)

This Topic is SOLVED …

Thank you again for your help …

1 Like