php 上传文件,设置文件的权限

  $upload_dir = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR;
    if (!is_dir($upload_dir)) {
        if (!mkdir($upload_dir, 0777)) {
            return $response->withJson(array('message' => '创建上传目录失败,请重试'), 400);
        }
    }

你可能感兴趣的:(php)