public function checkDirectory(\Phalcon\Http\Request\File $file = null, $value)
    {
        // conversion to the desired format

        if (is_array($value) === true) {
            $value = $value[key($value)];
        }

        if (file_exists($value) === false) {

            $this->errors[] = sprintf(Message::get('INVALID_UPLOAD_DIR'), $value);
            return false;
        }

        if (is_writable($value) === false) {

            $this->errors[] = sprintf(Message::get('INVALID_PERMISSION_DIR'), $value);
            return false;
        }

        return true;
    }