源码地带 > 电路图 > 电子资料下载 > 其他 >运用jdk > 查看压缩包源码

运用jdk

源代码在线查看: photo.jsp

软件大小: 45734 K
上传用户: jackjinke
关键词: jdk
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				
									String photo = (String)request.getParameter("photo");
					FileInputStream is = null; 
					DataInputStream in = null; 
					
				try{
				
					photo = oa.main.ParentBean.FilesPath + "news/img/" + photo;
					photo = (new oa.main.DealString()).Replace(photo,"\\","/");
					is = new FileInputStream(photo);
					in = new DataInputStream(is); 
					response.reset(); 
					if(photo.indexOf("gif")!=-1)response.setContentType("image/gif");
					else if(photo.indexOf("jpg")!=-1)response.setContentType("image/jpg");
					else if(photo.indexOf("png")!=-1)response.setContentType("image/png");
					else if(photo.indexOf("bmp")!=-1)response.setContentType("image/bmp");
					else if(photo.indexOf("jpeg")!=-1)response.setContentType("image/jpeg");
					byte[] b = new byte[1024]; 
					int len; 
					while((len=in.read(b)) >0) 
					response.getOutputStream().write(b,0,len); 	
				}finally{
					in.close();
					is.close();
				}%>
							

相关资源