Appnitro Software Forums » MachForm

How can I SET UPLOAD FILETYPE and SIZE?

(4 posts)
  • Started 1 month ago by nilsmierzynski
  • Latest reply from nilsmierzynski

  1. nilsmierzynski
    Member

    I would love to set the file types (like PDF, DOC, JPG) one can upload.
    I would also love to set the maximum file size one can upload.

    Is it possible to customize this?
    Has someone done this already here?

    Thank you!
    Nils

    Posted 1 month ago #
  2. Hi,

    What version do you have ? actually if you are using version 2.1.x there is some configuration in "config.php" try to search and set the value for these code :

    /** File upload limit **/
    define('UPLOAD_FILETYPE_ALLOW',''); //allow only these filetypes to be uploaded
    define('UPLOAD_FILETYPE_DENY','php;php3;php4;php5;phtml;exe;pl;cgi;html;htm;js');
    //do not allow these filetypes to be uploaded

    For file size limitation,I'm afraid it can't be done with machform. However you can set your "PHP.INI" file and set the maximum upload size. Search the following code:

    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 2M
    Posted 1 month ago #
  3. Yes, redityo is correct. I suggest to download the latest version (v2.1) from your customer area.

    then set this line on your config.php file:

    define('UPLOAD_FILETYPE_ALLOW','');

    to become:

    define('UPLOAD_FILETYPE_ALLOW','pdf;doc;jpg');
    Posted 1 month ago #
  4. nilsmierzynski
    Member

    Thank you!

    Machform was updated to the latest version by Appnitro free update service!
    Thank you for this brilliant service (by the way).

    I set the allowed document types in the config.php.
    I set the maximum filesize via .htaccess into the machform folder like this:

    php_value upload_max_filesize 3M

    For others:
    Copy the code line and paste it in a blank text document.
    Save it as "htaccess.txt" and upload it into the folder you run machform in.
    Now rename the file to ".htaccess" to become a system file which is invisible in most operation systems in standard setting. If you web server allows .htaccess this file will the the maximum file size which an be uploaded to 3 Megabyte (3M). You can change it to any size you like. This limit is active for the folder you place it (e.g. /machform) and all folders within this folder). Others folders and folders in higher position are not effected by this.

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.