·
Added a discussion

Setting an upload limit in permissions doesn't seem to apply to profile pics, which in turn allows me to upload and submit a 200mb jpg which crashes the entire website and makes all profile pictures fail to load. the website is gone for about 5-20 minutes (depending on how big the file is, we tried a lot) and it comes back either okay, or with missing images, which has to be reuploaded to get resolved. Is there a way to set upload limit for profile pics, and if yes, do so separately from the permission limit, because even 25mb seems to cripple the website for a bit. I'd ideally have 1.5mb for profile pic, and retain 25mb for standard users.

any help would be appreciated. I have access to the ftp, so I can change scripts if needed, just need to know what files to mess with so I don't irreversibly destroy the website lol Idm if this fix applies to admins as well, I just don't want my entire installation to crash whenever someone changes their profile picture.

  • 424
Comments
    • What type of server are you using?

      • Hi! I'm using the "shared unlimited" hosting plan from Dreamhost.

        • Shared is not the best option, you're running out of resources. Do you know your PHP options I would bet the memory limit is too low.

          • I know, but it's what I can afford for now, I want to limit the profile pic part regardless tho, as this is a concern regardless of hosting plan if users just upload 200mb files, bypassing the allocation limit...

            • You can limit the upload size via the php settings, which would limit all uploads.

              • can you share your dashboard site audit?

                Mine looks like,

                PHP:

                • version = 7.4.3-4ubuntu2.18 - OK
                • allow_url_fopen = On - OK
                • allow_url_include = Off - OK
                • magic_quotes_gpc = Off - OK
                • memory_limit = 1 GB - OK
                • post_max_size = 20 MB - OK
                • upload_max_filesize = 20 MB - OK
                • register_globals = Off - OK
                • safe_mode = Off - OK
                • disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, - OK
                • php module: curl = curl - OK
                • php module: gd = gd - OK
                • php module: mbstring = mbstring - OK
                • php module: json = json - OK
                • php module: fileinfo = fileinfo - OK
                • php module: zip = zip - OK
                • php module: openssl = openssl - OK
                • php module: exif = exif - OK

                Site optimization

                PHP:

                • PHP accelerator = APC - OK
                • PHP setup = fpm-fcgi - OK

                MySQL:

                • key_buffer_size = 384 MB - OK
                • max_heap_table_size = 16 MB - OK
                • tmp_table_size = 16 MB - OK
                • thread_cache_size = 8 - OK
                • mine looks like that too, everything says ok. we're going in circles here, I just need to set upload limit for profile pictures. regardless of my server limits. I would want that limit, even if I had nasa's computer.

                  • Hello @Nurf !

                    You may try to run the following query in your UNA database:

                    UPDATE `sys_objects_storage` SET `max_file_size`='new size in bytes' WHERE `object`='bx_persons_pictures';

                    (the size in Bytes is equal to the [N*1024*1024] value, where N is the up limit in Megabytes)

                    • would this affect profile picture upload size? I've noticed even this website (una.io) doesn't have that limit either. (I would never actually press upload, but everything seems reproduceable here.) I want users to be able to post up to 25mb per file, but profile pics to 1.5mb. if you know which file I'd need to modify for that, it would be pretty cool.

                      what you sent looks like it would affect everyone and everything(?)

                      • Yes, updated my post. Thnx for notice!

                        Login or Join to comment.