我很困惑。我将图像保存到临时文件夹。当表单未在提交时验证时,为什么表单会丢失图像名称?
继承人我所拥有的:
if(CUploadedFile::getInstance($model, 'product_image') !==null)
{
$product_image=CUploadedFile::getInstance($model,'product_image');
$f_product_image = "{$impdate}{$random6}{$product_image}";
$model->product_image = $f_product_image;
if($session['image0']&&file_exists($thumb.'thumb_'.$session['image0'])){
$old_name = $session['image0'];
unlink($url.$old_name);
unlink($thumb.'thumb_'.$old_name);
}else $session['image0']=$f_product_image;
}
else $model->product_image = $session['image0'];