Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-10070

ezbinaryfiletype.php insertRegularFile does not add file extension

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Duplicate
    • Affects Version/s: 3.6.11, 3.7.9, 3.8.6, 3.9.0
    • Fix Version/s: None
    • Component/s: Misc
    • Labels:
      None

      Description

      When doing imports from a cronjob, i use the following syntax for importing a file to a binary-file-datatype:

                      $result=array();
                      $status = $dataMap['file']->insertRegularFile( $contentObject,
                                                                  $contentObjectVersion,
                                                                  $objectLanguage,
                                                                  $filename,
                                                                  $result );
      

      This results in the file uploaded (import.pdf) being called something like:

      /var/ezwebin_site/storage/original/application/a0cf731ab72289d566bb509d3c5cc080

      This causes problems in search indexing of PDF, because it needs the extension to do search indexing. See the example here:
      http://ez.no/community/articles/indexing_multiple_binary_file_types/creating_the_file_parser_plugin

      However when i upload the file in the administration interface, the .pdf extension is preserved, and the file will be called something like:

      /var/ezwebin_site/storage/original/application/a0cf731ab72289d566bb509d3c5cc080.pdf

      This seems like a bug in kernel/classes/datatypes/ezbinaryfile/ezbinaryfiletype.php:insertRegularFile()

      The attached patch points out where the extension is found when uploading from the admin-interface, and fixes adds the extension in insertRegularFile()

      Steps to reproduce

      Send me an email, and i will provide the full code for the import.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              unknown unknown
              Reporter:
              kh Kristian Hole
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: