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

Allow really high file uploads, specially with 32 bits OSs

    Details

      Description

      If there's the need to upload really large files – 5Gb – in a 32bits OS, eZ will load the whole file into the memory which then will be exceeded.

      This is probably the bad line:

      kernel/private/classes/clusterfilehandlers/dfsbackends/dfs.php (115)
      $ret=$this->createFile($dstFilePath,file_get_contents($srcFilePath),true);
      

      the INT limit of a 32bit system will be simply exceeded.

      The idea would be, to use a functionality using the copy command instead. this command doesn't really need a lot buffer.

        Activity

        Hide
        Joao Inacio (Inactive) added a comment -
        Show
        Joao Inacio (Inactive) added a comment - PR with possible implementation: https://github.com/ezsystems/ezpublish-legacy/pull/1005
        Hide
        Gaetano Giunta (Inactive) added a comment -

        a wortwhile task: search for all usages of file_get_contents in the codebase (or unbounded file reads), to make sure that a stream-copy-to-stream approach is taken instead whenever possible

        Show
        Gaetano Giunta (Inactive) added a comment - a wortwhile task: search for all usages of file_get_contents in the codebase (or unbounded file reads), to make sure that a stream-copy-to-stream approach is taken instead whenever possible
        Hide
        Joao Inacio (Inactive) added a comment -

        Note:
        For some reason, PHP's builting stream_copy_to_stream() function also tries to fit the whole file in memory, as noted in the comments, so perhaps it's not suitable as an alternative.

        Show
        Joao Inacio (Inactive) added a comment - Note: For some reason, PHP's builting stream_copy_to_stream() function also tries to fit the whole file in memory, as noted in the comments, so perhaps it's not suitable as an alternative.
        Hide
        Bertrand Dunogier added a comment -

        I'm fine with the pull request, need more +1.

        Show
        Bertrand Dunogier added a comment - I'm fine with the pull request, need more +1.
        Show
        Joao Inacio (Inactive) added a comment - Merged in ezpublish-legacy/master: https://github.com/ezsystems/ezpublish-legacy/commit/f2b018add810504de84d09b7dda7e6fd9f11d63b
        Show
        Paulo Silva (Inactive) added a comment - On versions 4.7 and 5.0, it's needed to apply some previous patchs before the fix: 4.7 https://github.com/ezsystems/ezpublish-legacy-ee/commit/17d208a6ef372497cb576c99c7807c5555128e38 https://github.com/ezsystems/ezpublish-legacy-ee/commit/a540abc5a2b06fcd004cd4a9a287393139050444 5.0 https://github.com/ezsystems/ezpublish-legacy-ee/commit/9864204461858365e63a31af321bc913fbb34fc2 https://github.com/ezsystems/ezpublish-legacy-ee/commit/8d390cafff3ae1732078d2c0f1c17749a9a92bc6 Tested and Approved by QA for 4.7, 5.0, 5.1, 5.2, 5.3 and 5.4.

          People

          • Assignee:
            Unassigned
            Reporter:
            Eduardo Fernandes (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: