update from vb4 - Image upload failed because the extension of this file did not match the content.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • op2
    Member
    • Nov 2008
    • 76
    • 5.3.x

    update from vb4 - Image upload failed because the extension of this file did not match the content.

    HI
    I have updated my forum to VB5 from VB4. Now I can no more add any image (it works with zip and pdf)
    the message : Image upload failed because the extension of this file did not match the content.

    I have tested my image on the same server, on a fresh install of VB5 and then it works, but not in my updated one

    Could you please tell me what I have missed
    Regards
    French Joomla forum : https://forum.joomla.fr
  • K a M a L
    Senior Member
    • Dec 2009
    • 118

    #2
    Make sure the File is a Valid ZIP File

    Comment

    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 73976

      #3
      Images often have the wrong extension. Unfortunately, this frequently happens with mobile device images these days. They are stored in one file format and copied to the computer or browser often with just the extension changed. Many browsers and applications work around this by ignoring the extension. Which is a way to go but not the safest. The problem with this is that it causes security issues. Some image formats allow code to be embedded in different fields. On an improperly configured server, this can open you up for exploit.

      Due to this, we check the images. One of the easiest checks is extension mismatch. The image is labeled as a GIF when in fact it is a JPG. Looking at the code of the image can show this in the image's header. If we could demand how the thousands of different hosting providers configured their systems, we could work around this. One way to try and work around this the Imagemagick library. On many images, the software actually strips out a lot of the problematic fields and forces the server to rewrite the image as a proper JPEG file to work around this issue.

      To limit this issue, make sure you're using the latest version of vBulletin and update this line in your /core/includes/config.php file:
      Code:
      $config['Misc']['maxheight'] = 3456;
      to:
      Code:
      $config['Misc']['maxheight'] = 4608;
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API

      Comment

      • op2
        Member
        • Nov 2008
        • 76
        • 5.3.x

        #4
        it works with ZIP, not with images.
        wayne : I have tested on the same server config with a new install, and then it works
        I have tested the changes in the config file, no changes, does not work
        you are talknig about "Imagemagick library". Is there something to do with that ? can you give more explanations ?
        thanks
        French Joomla forum : https://forum.joomla.fr

        Comment

        • op2
          Member
          • Nov 2008
          • 76
          • 5.3.x

          #5
          PS : tested my image here, it works so the image is not a problem (same with all other images)
          Attached Files
          French Joomla forum : https://forum.joomla.fr

          Comment

          • op2
            Member
            • Nov 2008
            • 76
            • 5.3.x

            #6
            I'm sure that the problem comes from the update. Tested on another server, same problem :
            - new version works
            - verison updated from VB4 fails

            please le me know what I can do
            French Joomla forum : https://forum.joomla.fr

            Comment

            • op2
              Member
              • Nov 2008
              • 76
              • 5.3.x

              #7
              for info I have moved to another server, can this be a problem ? if the root path to the html folder has changed ?

              Please help me as I'm blocked and I need to put this new version live soon.
              French Joomla forum : https://forum.joomla.fr

              Comment

              • Wayne Luke
                vBulletin Technical Support Lead
                • Aug 2000
                • 73976

                #8
                If you have an absolute URL to storing your attachments specified under Attachments -> Attachment Storage Options in the AdminCP, then the path will matter. If it is a relative URL, then the path doesn't matter.

                Imagemagick is an image processing library that can be installed on your server. It is better than the GD library that PHP uses as a default. https://www.imagemagick.org/script/index.php You would have to discuss installing it with your server administrator. It may already be installed. Once installed, it can be configured under Settings -> Options -> Image Settings.

                You really haven't provided a lot of information on your server setup or configuration. So any attempt at the cause and/or solution is a guess at this time. There are dozens of different versions of vBulletin 5 and 20 different varieties of supported PHP versions. That is works on one installation and not the other, suggests there is something in the individual configurations of the server space causing the problem.
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API

                Comment

                • op2
                  Member
                  • Nov 2008
                  • 76
                  • 5.3.x

                  #9
                  tell me what you need as informations and I will give it
                  1/ Image Magick is installed. I have checked the config with the other fresh install where it works, no difference on the server config
                  2/ it can be configured under Settings -> Options -> Image Settings.
                  >> I have tested every setting here, nothing works
                  3/ Attachments -> Attachment Storage Options in the AdminCP,
                  >> I have already changed this path to the new one, does not work

                  is there somewhere some setttings that store the path on the server (in the DB ? in a file ?) that shall be changed after migrating the website to another server ?

                  for example
                  - the VB4 was installed in
                  home/olduser/public_html
                  - the VB5 is installed in
                  home/newuser/public_html



                  French Joomla forum : https://forum.joomla.fr

                  Comment

                  • op2
                    Member
                    • Nov 2008
                    • 76
                    • 5.3.x

                    #10
                    PS : I can also not change the logo image using the sitebuilder, I got a similare error
                    French Joomla forum : https://forum.joomla.fr

                    Comment

                    • op2
                      Member
                      • Nov 2008
                      • 76
                      • 5.3.x

                      #11
                      it works now !!!!
                      - created a "tmp" directory and updated the open base dir option in "“server settings & optimization options” to target this folder
                      not sure if this is the solution, but after trying many things and doing this it works
                      French Joomla forum : https://forum.joomla.fr

                      Comment

                      • Wayne Luke
                        vBulletin Technical Support Lead
                        • Aug 2000
                        • 73976

                        #12
                        Originally posted by op2
                        it works now !!!!
                        - created a "tmp" directory and updated the open base dir option in "“server settings & optimization options” to target this folder
                        not sure if this is the solution, but after trying many things and doing this it works
                        Yes, if your site has open_basedir enabled in PHP, then you need to specify a tmp directory. PHP won't be able to write to the system /tmp directory. We need to be able to write the file to the tmp directory in order to process the image.

                        Adding a Logo via Site Builder uses the same attachment system as posts.
                        Translations provided by Google.

                        Wayne Luke
                        The Rabid Badger - a vBulletin Cloud demonstration site.
                        vBulletin 5 API

                        Comment

                        Related Topics

                        Collapse

                        Working...