php - how to upload image? -


i want upload images in php here code

if (isset($_files['userfile']['name'])) {   if ($_files['userfile']['error'] == upload_err_ok) {     $from = $_files['userfile']['tmp_name'];     $to = "/var/www/html/images/".$_files['userfile']['name'];     $res = move_uploaded_file($from, $to);     if($res)     {       print 'upload success';     }       else     {       print 'fail';     }                

here got output fail please tell me correct process

thanks in advance

for images/ have checked permission on linux 755 or 777.

note: don't need absolute path can below.

$to = "images/".$_files['userfile']['name']; 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -