class action { function save_file() { # first, save the file with a temporary filename $save_path = dirname(__FILE__) . basename( $_FILES['userfile']['name']); if(move_uploaded_file($_FILES['userfile']['tmp_name'], $save_path)) { $ret = "The file ". basename( $_FILES['userfile']['name']). " has been uploaded"; } else { $ret = "Sorry, there was a problem uploading your file."; } return $ret; } } $myform = '
'; if ($_FILES) { $a = new action(); $result = "".var_dump($_FILES)."