note 46422 added to function.move-uploaded-file

From: Date: Sun, 10 Oct 2004 20:23:21 +0000
Subject: note 46422 added to function.move-uploaded-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-78310@lists.php.net to get a copy of this message
function upload_file($fld_name, $udir, $name=false) { if($name) { $res['fname'] = $name; $uploadfile = $udir."/".$name; } else { $uploadfile = $udir."/".$_FILES["$fld_name"]['name']; $res['fname'] = $_FILES["$fld_name"]['name']; } if (move_uploaded_file($_FILES["$fld_name"]['tmp_name'], $uploadfile)) { $res['msg'] = "File <b>{$uploadfile}</b> uploaded.<br>"; } else { $res['msg'] = "Error! Se the notes below:<br>"; print_r($_FILES); } return $res; } ---- Manual Page -- http://www.php.net/manual/en/function.move-uploaded-file.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46422 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46422&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+46422&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#78310) next »