WordPress.org

Ready to get started?Download WordPress

Forums

Simple Local Avatars
[resolved] How to set a filesize restriction (4 posts)

  1. cyrax83
    Member
    Posted 2 years ago #

    Is there a way to specify a size restriction? E.g. not allowed to upload an image greater than 500kb?

    E.g. if a user tries to upload a 50mb image file, I don't want the server to use bandwidth on it. It should spit out an error straight away

    Thanks

    http://wordpress.org/extend/plugins/simple-local-avatars/

  2. jaruzelskee
    Member
    Posted 1 year ago #

    Same question here.

  3. Jake Goldman
    10up Engineer
    Plugin Author

    Posted 1 year ago #

    It is subject to any file size restriction set by PHP or your server.

    Keep in mind that you should not need to worry about bandwidth: the plug-in automatically rescales your image to a requested size on the server. A 50mb image (which could only happen, given the supported file formats, with a MASSIVELY high resolution image) scaled to, say 32x32px upon request, would be pretty low bandwidth. The original file would never be served - only used to generate the various requested sizes. Since disk space is not at a premium on my most hosts (and if it is, there are usually small server-enforced sizes), I don't see this problem as a major issue.

    I strongly believe in simple plug-ins that don't litter WordPress with settings options, and I think it's a small niche that's concerned about huge JPG images being uploaded for avatars. That said, I'll strive to add a filter allowing developers to enforce avatar sizes in the next update.

  4. DeanGrey
    Member
    Posted 1 year ago #

    I had the same issue and a workaround I found is to use the "WP Image Size Limit" plugin. It does effect all image upload attempts though. The only drawback I saw when I tried to use it in conjunction with Goldman's plugin is that it removes the avatar that the person already had when it fails.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic