프로필 사진을 처리하기 위해 새 디렉토리를 만들려고하지만 이미지를 업로드 할 때마다 새 디렉토리가 만들어지지 않고 아무런 오류가 없습니다. 난 이미 여기 PHP mkdir이 새 디렉토리를 만들지 않습니다.
은 여러가 내 코드//profile image upload script
if (isset($_FILES['profile_pics'])) {
if (((@$_FILES["profile_pics"] ["type"] == "image/jpeg" || (@$_FILES["profile_pics"] ["type"] == "image/png") || (@$_FILES["profile_pics"] ["type"] == "image/gif")) && (@$_FILES["profile_pics"] ["size"] < 1048576))) // LESS THAN ONE MEGABYTE
{
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$rand_dir_name = substr(str_shuffle($chars), 0, 15);
mkdir("userdata/profile_pics/$rand_dir_name");
else {
}
} }
파일 상단에 오류보고를 추가하십시오 :' php \t \t ini_set ("display_errors", 1); \t \t error_reporting (E_ALL); \t?> 그리고 오류를 알려주십시오. 또한 새 하위 디렉토리를 만들 수있는 디렉토리의 사용 권한을 확인하십시오 – Rizier123
새 디렉토리를 만드는 디렉토리에 적절한 권한이 있는지 확인하십시오 – Nick
도움이 될 수 있습니다 : http://stackoverflow.com/questions/7101840/ mkdir-failed-creating-directory-php? rq = 1 http://stackoverflow.com/questions/13908722/php-unable-to-create-a-directory-with-mkdir?rq=1 –