VB v3.5.1 Attachment Size Limit.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • flow_
    New Member
    • Dec 2005
    • 5
    • 3.5.x

    #16
    Jake, sorry, I didn't realise you posted this before. Anyway, this is just to confirm that the problem exists on 3.5.2 and that it's probably due to a bug (no hacks or plugins on my system).

    Thanks

    Comment

    • Zachery
      Former vBulletin Support
      • Jul 2002
      • 59097

      #17
      Possibly a server issue, flow please start your own thread.

      Comment

      • neuston
        New Member
        • May 2006
        • 14

        #18
        STOP STOP STOP ASKING US TO START A NEW THEAD OR SUPPORT TICKET!!!!
        It is not an individual case, it is a serious BUG of vbulletin.
        Try searching "attachment size" here, and you can see:
        MANY MANY MANY OF USERS GOT THE SAME PROBLEM!
        and the support staffs here never listen and solve the bug

        Also stop saying that the problem is related to server issues or hacks. The servers today normally allow at least 2mb maximum upload size. And we can upload large size files using another php/mysql program in the same server.

        ARE YOU LISTEN TO US?


        Comment

        • Zachery
          Former vBulletin Support
          • Jul 2002
          • 59097

          #19
          It is an indivudal case as each user may have differnt server enviroments or issues that need dealing with.

          Its not a bug, as much as you may wish it is, it is not.

          By default mysql's max_packet_size is set to 1024 kilobytes, however most admins change this to at least 2048. Most of the time the optimial setting is somewhere between 8-16MB.

          However storing binary data like attachments in the database is not the best way to do things, however some users are in overly restricted enviroments and don't have any other options. If you are in an enviroment where safe-mode or open_basedir is turned off you can store attachments as files. Then what comes into play more is php's memory limit, max_upload_size and max_post_size, as well as the max_execution_time.

          The vBulletin software does not normally have control over all of these aspects so its best if you can get your host to change them or find out if you can change them yourself.

          Again, there is no bug with vBulletin.

          Comment

          • neuston
            New Member
            • May 2006
            • 14

            #20
            okay, let me clear one thing:

            Steve always tell us to change the max_upload_size, max_post_size, and max_execution_time......etc. to solve the problem, this action will not take any effect, (as lots of us experienced), when we save our attachments in database, won't it?

            It only takes effect when we change the storage type as "files", right?

            Comment

            • neuston
              New Member
              • May 2006
              • 14

              #21
              okay, sorry if I said something wrong. However, I think vb should write some guideline in detail of how to deal with this common problem, instead keep pushing their clients to solve the problem themselves in the server side

              Whatever, here is my individual case:


              Please help. Thank you.

              Comment

              • Zachery
                Former vBulletin Support
                • Jul 2002
                • 59097

                #22
                In your thread


                upload_max_filesize = 2M

                Which means you are limited to 2m. Its a server issue.

                Comment

                • RayJohns
                  New Member
                  • Oct 2008
                  • 1
                  • 3.7.x

                  #23
                  I ran across this thread tonight while working on some issues related to the attachment sizes for gifs and jpegs, etc on my installation of vbulletin. For about a week, I thought I had an error that related to the lack of gif support in gdlib. I am running under FreeBSD with PHP compiled in as a static module inside of httpd (for speed).

                  In setting up and testing the attachment area of VB, I noticed that I was getting errors when trying to upload GIF files and/or when trying to generate thumbnails. The VB tech support guys made some suggestions as to what to check, but I was still unable to resolve the issue. I was able to get jpeg and png files to work, but for some reason I couldn't get GIF.

                  I compiled the latest version of GD lib, which said it supported gif. Hmm... strange. I still couldn't get my "test" gif file to upload. Then when I started to fiddle with things again, I noticed some (but not all) of my jpeg files wouldn't upload either. WTF?

                  I went into the VB attachment manager and changed all the sizes to 3072x3027 and set the file size to 3670016 (aka 3.50 MB). Still no luck on some of the larger JPG files, as well as my "little" test GIF file. I was almost going to switch over to Imagemagick, when I decided to do some more checking around (that's when I ran across this thread actually).

                  I am happy to report that I finally got VB to allow me to upload all file types, including GIF files as attachments. It also properly created thumbnails, even for gifs.

                  Turns out my problem wasn't related to gdlib at all. It turned out the problem was related to the upload_max_filesize setting in the PHP.INI config file. As it turned out, my "little" test GIF file was 3.1 megs. Even thought I had VB configured to accept 3.50 MB attachments, PHP wasn't allowing it. I was getting an "upload failed" error message. Once I changed the PHP.INI setting (as follows), everything suddenly started working:

                  upload_max_filesize = 4M

                  Like I say, once I changed this from default 2MB size to 4MB, suddenly everything started working with my attachments. Keep in mind, if you have PHP compiled in as a static module (which I do), you *must* stop (not restart) httpd in order to flush the PHP module from memory and force its reloading. Just restarting the httpd will not reload PHP and thus will not take into account the new settings in PHP.INI.

                  A couple of other things to be aware of when trying to get VB to handle larger attachments:

                  make sure the file size is increased in forums/includes/config.php as such:

                  $config['Misc']['maxwidth'] = 3072;
                  $config['Misc']['maxheight'] = 3072;

                  additionally, it's not a bad idea to adjust the following in PHP.INI

                  memory_limit = 32M (or perhaps 64M)
                  post_max_size = 8M

                  In your MySQL config file, you may wish to change these settings to help handle larger attachment uploads. I found it helped on my installation when I got a "packet bigger than 'max_allowed_packet' bytes" error message on the database: (these are just suggested values)

                  max_connections = 500
                  wait_timeout = 7200
                  connect_timeout = 10
                  key_buffer = 384M
                  max_allowed_packet = 64M
                  table_cache = 1024
                  sort_buffer_size = 64M
                  read_buffer_size = 64M
                  read_rnd_buffer_size = 8M
                  myisam_sort_buffer_size = 64M
                  thread_cache_size = 384
                  query_cache_size = 128M
                  thread_concurrency = 8

                  Another thing I did was reconfigure VB to store attachments in the file system, not the MySQL database. I personally don't want 3+ MB binary graphic files stored in my database. If you feel the same, you can reconfigure VB to store the attachments in a directory on the server, as opposed to in the database itself. This can be done in VB here:

                  Attachments --> Attachment Storage Type

                  Then follow the directions to move the attachments into the file system and out of the MySQL database. You'll need to create a directory to store the attachments in. Make sure this directory is not under your public webserver directory. It's better to put it one level above or some place in the file system where only the system admin has access to it. Make sure httpd can write to it by changing the permissions to a+w (i.e. chmod 0777). Once this is done, tell VB to move the attachments out of the database and into the file system).

                  I don't know if this makes things faster or slower, but I will sleep better at night knowing all the attachments are on the hard drive, not taking up space in some MySQL table :-) I think it will also make backing up the attachments (and protecting them from loss) a little easier.

                  Anyway, I just wanted to pass along a few tips that I ran across while getting this to work smoothly. The PHP upload file limit really made this error difficult to resolve. Like I say for a while I was thinking gdlib was at fault, when actually it was PHP limiting the size of attachments probably the whole time.

                  BTW, if you are having problems along these same lines, make sure you actually do have gd compiled properly into PHP. You can do this with the following command:

                  /usr/local/bin/php -m

                  this should list the modules in PHP. Run the command and make sure you see "gd" in the list. If you are on FreeBSD and PHP is in another directory, you can usually type "which php" to locate the proper binary.

                  okay, back to work.... I just wanted to pass a long a bit of the fun I was having with gif files and attachmens on VBulletin tonight :-)

                  Ray Johns
                  www.DayTrader.com
                  Last edited by RayJohns; Fri 31 Oct '08, 3:11am.

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...