Exemplo n.º 1
0
 /**
  * Returns the content type of the specified file (as supplied by the client browser), or null if
  * the file was not included in the upload.
  *
  * @param name the html page's file parameter name.
  * @return the content type of the file.
  */
 public String getContentType(String name) {
   try {
     UploadedFile file = (UploadedFile) files.get(name);
     return file.getContentType(); // may be null
   } catch (Exception e) {
     return null;
   }
 }