我无法使用以下代码在服务器上上传图片。得到例外:can't read input stream with URL
BufferedImage image = null;
try {
URL url = new URL("http://www.mkyong.com/image/mypic.jpg");
image = ImageIO.read(url);
ImageIO.write(image, "jpg",new File("C:\\out.jpg"));
ImageIO.write(image, "gif",new File("C:\\out.gif"));
ImageIO.write(image, "png",new File("C:\\out.png"));
} catch (IOException e) {
e.printStackTrace();
}