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

Wiki page attachment is empty after export/import



      1. Create a wiki page at Control Panel > Content > Wiki
      2. Add an attachment to the page, e.g. an image file
      3. Export the wiki portlet data to a LAR file with default settings (using the gear icon in the upper right of the admin page)
      4. Create a new site and import this LAR file on the wiki admin page
      5. Open the wiki page and then it's attachment

      Result: The attachment file is empty (0 Kb)

      Root cause: MimeTypesImpl.getContentType(InputStream, String) modifies the InputStream that is passed to it, as a side effect. (It is done by the Apache Tika library.) Because of this, when creating a file object from the same InputStream after this call, it results in an empty file. We should avoid calling directly MimeTypesUtil.getContentType(InputStream, String) in case we want to use that InputStream object afterwards.


          Issue Links



              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Days since last comment:
                  5 years, 15 weeks ago


                  Version Package
                  6.2.4 CE GA5
                  6.2.X EE
                  7.0.0 M4