解决方案 »
- 如何用java获取excel中选中部分,使用的是poi包。
- 神奇的@include
- 推荐一个“开源”的浏览器,只有4m,没有前进、后退、地址栏等操作
- JBOSS不能通过IP访问
- jsp 调用web service: Could not invoke service
- 同一个EJB,同一个Client端程序在两台电脑上得到的结果就不一样。一个可运行, 一个则报异常
- 请问,如何获得ejb3.0 webservice 的调用者的IP??谢谢
- ora-01841
- 请教 错误提示The Network Adapter could not establish the connection
- 如何访问其他的机器的问题
- pull技术如何读取这段xml
- 关于提交表单参数个数确定·struts1.x该如何去接收?
public void upload(){
try {
//创建文件流,用来读写
//1. 创建写入对象
FileOutputStream out = new FileOutputStream(new File(ServletActionContext.getServletContext().
getRealPath("/")+"/upload/"+getImageFileName()));
System.out.println("--->:"+getImage());
//2. 创建读取对象
FileInputStream in = new FileInputStream(getImage());
//3.一边读取一边写入
byte [] data = new byte[1024];//
int len = 0;
while((len=in.read(data))>0){//read()方法,用来将数据读取到数组中,返回读取的个数
out.write(data,0,len);
}
out.close();
in.close();
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("哈哈,上传cheng共!");
}