hamishcampbell / silverstripe-securefiles

SilverStripe Secure Files Module
http://polemic.net.nz
Other
21 stars 22 forks source link

Wrong database-field for "Filename" #6

Closed oliverwendenburg closed 12 years ago

oliverwendenburg commented 12 years ago

Using the "Filename"-Field from the database results in changed filenames on download, within this field SilverStripe stores the whole path

assets/Uploads/SilverStripe.png

so on download what you get will be named

assets-uploads-silverstripe.png

Used field should be "Name" instead of "Filename", so the old code of SecureFilesController.php looks like

    function fileFound(File $file, $alternate_path = null) {

        // File properties
        $file_name = $file->Filename;
                ......
        }

but should be

    function fileFound(File $file, $alternate_path = null) {

        // File properties
        $file_name = $file->Name;
                ......
        }