如何验证上传的文件是不是图片 如下代码File upload = new File("路径");BufferedImage image = null;try {image = ImageIO.read(upload);if(image == null){ System.out.println("上传的不是图片");}} catch (Exception e) {e.printStackTrace();}