code: @WebOperationMethod
      public Map<String,Object> upload(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) throws Exception {
  
          Map<String,Object> result = Objects.newSOHashMap();
          String database = (String) params.get("database");
          String collection = (String) params.get("collection");
          String taskId = (String) params.get("task");
          if (Objects.isNullOrEmpty(collection))
              collection = COLLECTION;
  
          if (params.containsKey("file")) {
              String id = UUID.randomUUID().toString();
  
              final FileParameter fp = (FileParameter) params.get("file");
  
              writeFile(taskId,new Id(database,collection,id),fp);
              result.put("id", id);
          } else {
              List<String> ids = new ArrayList<String>();
              int i = 0;
              while (result.containsKey("file" + i)) {
                  String id = UUID.randomUUID().toString();
  
                  final FileParameter fp = (FileParameter) params.get("file" + i);
  
                  writeFile(taskId,new Id(database,collection,id),fp);
  
                  ids.add(id);
              }
              result.put("ids", ids);
          }
          return result;
      }
docs: Upload file
  
  @param params {group:"...default is GROUP...", file: FileParameter}
  @param result will be {id:"..."}
  @throws Exception
  @see org.s1.weboperation.MapWebOperation.FileParameter