1、图片再服务器上的存储形式:图片存在磁盘文件中,数据库保存图片的存储路径
String bitmapStr = request.getParameter("bitmap");
String bitmapPath = null;
<span style="white-space:pre"> </span>//对客户端传的图片字符串进行解码
<span style="white-space:pre"> </span>try{
<span style="white-space:pre"> </span>byte[] picture = new BASE64Decoder().decodeBuffer(bitmapStr);
for(int i=0; i<picture.length; i++){
<span style="white-space:pre"> </span>if(picture[i] < 0){
picture[i] += 256;
}
}
//将图片存入文件中
String filePath = "E:\\picture\\test\\";
String pictureName = "p" + idStr +".png";
File pictureFile = new File(filePath,pictureName);
bitmapPath = filePath + pictureName; //数据库保存图片路径
FileOutputStream fileStrea