@PostMapping(value = "/upload")
    @Log
    @ResponseBody
    public String file(final String token, @RequestParam("file") final MultipartFile file) {
        try {
            WebSocketSession webSocketSession = WsSessionManager.get(token);
            if (Objects.isNull(webSocketSession)) {
                return "User login has expired";
            }
            if (file.getOriginalFilename().endsWith(".bin")) {
                webSocketSession.sendMessage(new BinaryMessage(file.getBytes()));
            }
        } catch (Exception e) {
            // ignore exception
        }
        return "ok";
    }
Upload files.
@param token session key
@param file file
@return response
shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/controller/TestHttpController.java