Warning: rename(k.jpg,) [function.rename]: No error in C:\xampp\htdocs\xampp\uploader.php on line 15 -


warning: rename(k.jpg,) [function.rename]: no error in c:\xampp\htdocs\xampp\uploader.php on line 15

i keep getting error, though file keeps getting moved correct folder...

$target_path = "schlimage/"; $school_name= $_session["school_username"]; $nm=$_files['uploadedfile']['name'];  $target_path = $target_path . basename( $_files['uploadedfile']['name']);   if(move_uploaded_file($_files['uploadedfile']['tmp_name'], $target_path)) {     echo "the file ".  basename( $_files['uploadedfile']['name']).          " has been uploaded"; } else {     echo "there error uploading file, please try again!"; }  rename($nm,$school_name); 

rename($nm,$school_name); 

change to

$co = substr_count($nm,'.'); $ex = explode('.',$nm); rename($target_path,"schlimage/".$school_name.".".$ex[$co]); 

see rename php function


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -