How can I allow more file extensions with file uploads?
You actually have to check for the return values of the file_validate_extensions() function in order to detect if any errors have occurred.

so your code would be something like this:

$fid = $form_state['values']['attachment'];
$file = file_load($fid);

if ($file != null) {
  $extension_errors=file_validate_extensions($file, "jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp docx");
  if (!$extension_errors) {
  $file-&gt;status = FILE_STATUS_PERMANENT;
  file_save($file);
  } else form_set_error('attachment',$extension_errors[0]);
}