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

eZFile download filename issue

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 2011.10, 4.5.0, 4.6.0
    • Upgrading
    • None

    Description

      Hello,

      The behavior of file download with eZFile::download method has changed between 4.4 and 4.5.

      In 4.4, if the filename was not overrided with the third parameter of this method, the filename was sent in the header from the information returned by eZMimeType::findByURL.

      In 4.5, if the filename is not overrided, no filename is sent in the header and the file to downlad takes the name of the last part of the url.

      For example, let's say I have a module to download a file made of node informations (node id 10245) at /mymodule/download/10245 which creates a temp file on disk named toto.txt (its full path is in $fullPathToMyFile).

      In 4.4, a call to eZFile::download( $fullPathToMyFile ) would have offered me to download a file named "toto.txt".
      In 4.5, the same call offers me to download a file named "10245".

      Is this modification intentional or is this a bug ?

      Shouldn't this line from ezfile.php :

      ( $overrideFilename !== false ? "; filename={$overrideFilename}" : '' )
      

      be :

      ( $overrideFilename !== false ? "; filename={$overrideFilename}" : "; filename=".$mimeinfo['filename'] )
      

      ?

      Thanks

      Attachments

        Activity

          People

            unknown unknown
            fminov fminov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: