0) { echo 'Problem: '; switch ($userfile_error) { case 1: echo 'File exceeded upload_max_filesize'; break; case 2: echo 'File exceeded max_file_size'; break; case 3: echo 'File only partially uploaded'; break; case 4: echo 'No file uploaded'; break; } exit; } $upfile = ''.$userfile_name; if (is_uploaded_file($userfile)) { if (!move_uploaded_file($userfile, $upfile)) { echo 'Problem: Could not move file to destination directory'; exit; } } else { echo ' '.$userfile_name; exit; } echo 'File uploaded successfully

'; echo 'Preview of uploaded file contents:

'; echo $contents; echo '

'; ?>