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 -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -