• In reference to Contact Form 7 file upload feature i am using the following code for size limit:
    [file* file-868 limit:3mb]
    however it gives an error if file is above 1mb and only uploads files 1mb or less.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 23 total)
  • The 1 mb limit could be being imposed by your WordPress hosting – I’d check with them.

    Thread Starter kharoon

    (@kharoon)

    I am using powweb.com for web hosting and have checked with them. Their limit is 20mb.

    Thread Starter kharoon

    (@kharoon)

    i am trying to limit it to 3mb

    Moderator James Huff

    (@macmanx)

    The maximum upload size is controlled at the server-level, not by WordPress or Contact Form 7. Here are three ways you can increase the upload limit:

    1. If you can edit or override the system php.ini file, increase the maximum file and post sizes. For example, upload_max_filesize = 100M ; and post_max_size = 100M ;

    2. If you cannot edit or override the system php.ini file, add php_value upload_max_filesize 100M and php_value post_max_size = 100M to your .htaccess file.

    3. If neither of these work, it’s time to ask your hosting provider to increase the maximum file and post sizes on your account. Keep in mind that most decent hosting providers allow this, and If your hosting provider won’t accommodate you, perhaps it’s time to find a new hosting provider.

    (in the above examples, the limit is set to 100MB)

    @macmanx – thanks for the detailed advice. I’ve bookmarked this for future reference.

    Thread Starter kharoon

    (@kharoon)

    Thanks James, but php.ini is already set to 20M. Adding the code to .htaccess gives an internal error message.

    Moderator James Huff

    (@macmanx)

    Are you able to upload the file via Media > Add New in your site’s Dashboard without issue?

    Thread Starter kharoon

    (@kharoon)

    Yes, no issues in that. It also displays at the bottom of that page “Maximum upload file size: 20 MB” indicating that it is properly synced with php.ini. I uploaded 7mb file without any issue.

    I also tried file uploader plugin which uploads into the wp-content/uploads folder. Even that is working fine.

    In wp-content/uploads folder there is a contact form 7 folder with an empty .htaccess file. I put php_value upload_max_filesize 100M and php_value post_max_size = 100M there but no help.

    Note: I am putting php_value upload_max_filesize 100M as it is without any quotes etc, is that right or i need to affix it with something else?

    Moderator James Huff

    (@macmanx)

    Hm, ok it’s not the upload limit then, that’s odd.

    I guess the problem is indeed with the shortcode parameter, possibly a bug, but having never used it myself I’m not sure.

    Someone with a bit more knowledge and experience on this should be along.

    I guess the problem is indeed with the shortcode parameter, possibly a bug, but having never used it myself I’m not sure.

    The CF7 tag looks fine. I also don’t think it’s a bug. I use the file upload feature on several forms and get emails with uploaded files of varying sizes every day.

    @kharoon – can you confirm that you are testing this on desktop & not via mobile?

    Noticed that you’re also not controlling filetypes in your CF7 tag. This can help with avoiding hosting Modsec rules.

    Thread Starter kharoon

    (@kharoon)

    @james: Thanks for your effort ??

    @neil: Yes I am using the laptop and not a mobile.

    Noticed that you’re also not controlling filetypes in your CF7 tag

    I don’t think that should be an issue since CF7 is supposed to apply default restrictions for file types when you do not set it in the tag. Nevertheless, changed the tag to this: [file* file-868 filetypes:pdf|doc|docx limit:3mb] but it still didn’t work.

    Can you share your tag format please to see if that works. Thanks.

    Your CF7 file tag format is correct & similar to what I use. I definitely don’t think that CF7 is causing your problem.

    I’d recommend you ask your hosting about what Modsec rules they apply to file uploads via HTML form submissions.

    My experience in dealing with a range of hosts is that you often won’t get accurate advice until you ask very specific & detailed questions.

    Thread Starter kharoon

    (@kharoon)

    ok thanks will do and get back

    Thread Starter kharoon

    (@kharoon)

    just a second thought, I still haven’t upgraded from php 5.3 do u think that might be an issue?

    • This reply was modified 6 years, 3 months ago by kharoon.
    Thread Starter kharoon

    (@kharoon)

    Changing php versions didn’t help. Contacted the hosting staff to inquire about modsec rules. He didn’t comment anything on that but tried changing the php memory limit to 256 from 128 but no help. He has raised a ticket, so lets see what the tech department says.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘File Upload Limit’ is closed to new replies.