Ejemplo n.º 1
0
 public function upload($file, $destiny)
 {
     //echo "FILE: {$_FILES[$file]['name']}, SIZE: {$_FILES[$file]['size']} IS UPLOADED: ".is_uploaded_file($_FILES[$file]['tmp_name']);
     if (isset($_FILES[$file]) and $_FILES[$file]['size'] > 0 and is_uploaded_file($_FILES[$file]['tmp_name'])) {
         $dir = dirname($file);
         folder::create_dir($dir);
         //echo '<h3>'.$_FILES[$file]['tmp_name'].' to '.$destiny.'</h3>';
         return move_uploaded_file($_FILES[$file]['tmp_name'], $destiny);
     } else {
         return false;
     }
 }