Skip to content

[cookbook] use __dir__ in file_upload #3582

@ochurlaud

Description

@ochurlaud

in how to handle file uploads with doctrine, the doc use the _ _ dir _ _ variable.

According to SensioLabs Insight, it's not a "best practise". How can one handle this ?

Thx...

   protected function getUploadRootDir()
    {
        // the absolute directory path where uploaded
        // documents should be saved
        return __DIR__.'/../../../../web/'.$this->getUploadDir();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions