I use wamp, to implement the file upload function if the file name uploaded is Chinese, it will be garbled , but the information in the database is correct . How to solve this?
in addition, when accepting form information to create a folder, if it is in Chinese, the name of the created folder will also be garbled.
if($image_files = request()->file("image_uploads"))
{
foreach($image_files as $file){
$info = $file->move(ROOT_PATH . "public" . DS ."static" . "\\" . $title ."\\". "Picture" ,"");
if($info){
$path_parts = pathinfo(ROOT_PATH . "public" . DS . "static" ."\\". $info->getFilename());
//
$type=$path_parts["extension"];
$name=$path_parts["filename"];
$size=(filesize(ROOT_PATH . "public" .DS. "static" ."\\". $title ."\\". "Picture" . "\\" .$info->getFilename())>>10)."KB";
$data=["name"=>$name,"type"=>$type,"size"=>$size,"activity_id"=>$activityId];
Db::table("file")->insert($data);
}else{
//
$this->error($file->getError());
}
$upload_status = 1;
}