将网站放在阿里云上,之后点击图片下载,图片下载在阿里云的D盘上,如何才能让图片下载到用户的电脑上?
部分代码如下:
String savePath = "D:\upload\";
File downloadFile1 = new File(savePath);
if (!downloadFile1.exists()) {
downloadFile1.mkdirs();
}
File file1 = new File(savePath + "\" + filename + "." + format);
if (!ImageIO.write(image, format, file1)) {
throw new IOException("Could not write an image of format " + format + " to " + file1);
}