yii - losing image when form is not valid -


i quite stuck. saving image temporary folder. when form doesn't validate on submit, why form lose image name?

heres have:

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']; 


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

c# - How do I get the Nth largest element from a list with duplicates, using LINQ? -

jsp - "Sending a redirect is forbidden after the response has been committed" in sendRedirect -