这是修改之前的代码
if(!empty($_FILES)){
if(!empty($_FILES['org_positive'])){
$org_positive = request()->file('org_positive');
if($org_positive){
$info = $org_positive->move(ROOT_PATH . 'uploads');
$positive_path="/uploads/".$info->getSaveName();
}else{
$positive_path="";
}
}
if(!empty($_FILES['org_reverse'])){
$org_reverse = request()->file('org_reverse');
if($org_reverse){
$info1=$org_reverse->move(ROOT_PATH . 'uploads');
$reverse_path="/uploads/".$info1->getSaveName();
}else{
$reverse_path="";
}
}
if(!empty($_FILES['org_license'])){
$org_license = request()->file('org_license');
if($org_license){
$info2=$org_license->move(ROOT_PATH . 'uploads');
$license_path="/uploads/".$info2->getSaveName();
}else{
$license_path="";
}
}
}
在处理$_FILES第二个元素的时候出现了以下错误
这是改良之后的代码
if(!empty($_FILES)){
if(!empty($_FILES['org_positive'])){
$org_positive = request()->file('org_positive');
}
if(!empty($_FILES['org_reverse'])){
$org_reverse = request()->file('org_reverse');
}
if(!empty($_FILES['org_license'])){
$org_license = request()->file('org_license');
}
if($org_positive){
$info = $org_positive->move(ROOT_PATH . 'uploads');
$positive_path="/uploads/".$info->getSaveName();
}else{
$positive_path="";
}
if($org_reverse){
$info1=$org_reverse->move(ROOT_PATH . 'uploads');
$reverse_path="/uploads/".$info1->getSaveName();
}else{
$reverse_path="";
}
if($org_license){
$info2=$org_license->move(ROOT_PATH . 'uploads');
$license_path="/uploads/".$info2->getSaveName();
}else{
$license_path="";
}
}
本人是小白,在网上查找到资料说php上传文件后较短时间会删除临时文件,也就是$_FILES[‘file'][‘tmp_name']这个值,修改代码之后没有报错了,成功将临时文件转移了出来
疯狂医院达什医生中文版(Crazy Hospital)
疯狂医院达什医生最新版是一款医院模拟经营类游戏,逼真的场景画
宝宝庄园官方版
宝宝庄园官方版是一款超级经典好玩的模拟经营类型的手游,这个游
桃源记官方正版
桃源记是一款休闲娱乐类的水墨手绘风格打造的模拟经营手游。玩家
长途巴士模拟器手机版
长途巴士模拟器汉化版是一款十分比真好玩的大巴车模拟驾驶运营类
房东模拟器最新版2024
房东模拟器中文版是一个超级有趣的模拟经营类型的手游,这个游戏