private String[] extractDispositionInfo(String aLine) throws IOException
   {
      String[] retval = new String[3];
      String myline = aLine.toLowerCase();

      // get content disposition -- should be "form-data"
      int start = myline.indexOf("content-disposition: ");
      int end = myline.indexOf(";");
      if (start == -1 || end == -1) throw new IOException("Content disposition info corrupt: " + aLine);
      String disposition = myline.substring(start+21, end);
      if (!disposition.equals("form-data")) throw new IOException("Invalid content disposition: " + disposition);

      // get field name
      start = myline.indexOf("name=\"", end);  // start where previous ended
      end = myline.indexOf("\"", start + 7);
      if (start == -1 || end == -1) throw new IOException("Content disposition info corrupt: " + aLine);
      String name = aLine.substring(start+6, end);

      // get file name if provided
      String filename = null;
      start = myline.indexOf("filename=\"", end+2);
      end = myline.indexOf("\"", start+10);
      if (start != -1 && end != -1)
      {
         filename = aLine.substring(start+10, end);
         // clip path if present
         int slash = Math.max(filename.lastIndexOf('/'), filename.lastIndexOf('\\'));
         if (slash > -1) filename = filename.substring(slash+1);
         if (filename.equals("")) filename = "unknown";
      }

      // return a string array
      retval[0] = disposition;
      retval[1] = name;
      retval[2] = filename;
      return retval;
   }