Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-50275

Uploading images to Web Content that exceed the DL file size is handled ungracefully

Details

    Description

      When you upload a file into Web Content that exceeds dl.file.max.size, Liferay does not handle it gracefully like it does with Docs & Media. D&M will tell you that the file is too large, whereas Web Content will throw an error in the logs and just say "Web Content is temporarily unavailable" in the GUI.

      Steps to Reproduce
      1. Set dl.file.max.size=1 in your portal-ext.properties. You can also set this in Server Administration -> File Upload, but the properties is faster
      2. Create a web content Structure with an Image field (see screenshot)
      3. Create a Template that uses the Structure you created in Step 3. The template script can be blank.
      4. Create a new web content by selecting the Structure.
      5. In the image field, upload any image.
      6. Click on Publish
      ACTUAL: You'll see the errors described in the below section
      EXPECTED: Liferay will gracefully tell you that your image exceeds the $DL-FileSize, just like it does for Docs & Media.
      I think this is a bug because Liferay handles this in Docs &Media by telling you that you've exceeded the set Max size, but it doesn't in web content. This behavior should be consistent.

      Errors
      GUI error - Web Content is temporarily unavailable
      Log error:

      18:08:43,277 ERROR [http-bio-8080-exec-5][render_portlet_jsp:154] com.liferay.portlet.documentlibrary.FileSizeException: 10441.jpg
              at com.liferay.portlet.documentlibrary.store.DLStoreImpl.validate(DLStoreImpl.java:571)
              at com.liferay.portlet.documentlibrary.store.DLStoreImpl.addFile(DLStoreImpl.java:80)
              at com.liferay.portlet.documentlibrary.store.DLStoreUtil.addFile(DLStoreUtil.java:101)
              at com.liferay.portal.image.DLHook.updateImage(DLHook.java:85)
              at com.liferay.portal.service.impl.ImageLocalServiceImpl.updateImage(ImageLocalServiceImpl.java:302)
              at com.liferay.portal.service.impl.ImageLocalServiceImpl.updateImage(ImageLocalServiceImpl.java:278)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
              at com.liferay.portal.security.pacl.PACLAdvice.invoke(PACLAdvice.java:51)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
      

      Testing
      Reproduced on 6.1.x dedd2f0f8892ff7e8851238dce1172270500e7c4
      Reproduced on Master afc8c21b2c24c505625f24705bd88ec3396d11ca

      Attachments

        1. failed.png
          failed.png
          25 kB
        2. fixed.png
          fixed.png
          14 kB
        3. reproduced.png
          reproduced.png
          6 kB

        Issue Links

          Activity

            People

              yvonne.han Yvonne Han
              steven.smith Steven Smith (Inactive)
              Rafaela Nascimento Rafaela Nascimento
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8 years, 19 weeks, 5 days ago

                Packages

                  Version Package
                  6.1.X EE
                  6.2.2 CE GA3
                  6.2.X EE
                  7.0.0 M2