关于在JSP中上传图片的相关问题 - Web 开发 / 其他
//用客户的session的id建立一个临时文件:
//String tempFileName=(String)session.getId();
String tempFileName = (String)session.getId();
//out.println("id:"+tempFileName);
//建立临时文件f1:
File f1 = new File("E:/S2文件/JSP/", tempFileName);
//创建指向f1临时文件的输出流对象
FileOutputStream o = new FileOutputStream(f1);
//将客户上传的全部信息存入f1:
InputStream in = request.getInputStream();
byte b[] = new byte[10000];
int n;
while ((n = in.read(b)) != -1) {
o.write(b, 0, n);
}
o.close();
in.close();
麻烦大家帮我看下上面代码中的其中
InputStream in = request.getInputStream();
byte b[] = new byte[10000];
int n;
while ((n = in.read(b)) != -1) {
o.write(b, 0, n);
}
这几行是什么意思。
{{
相关问答:
在查询后将查询出来的值赋给各输入框
<c:if test="${not empty dataValue}">
fm.SAMPLING_DATE.value=" <c:out value='${dataValue.SAMPLING_DATE}'/ ......
我的开发的平台是Myeclipes6.0 + tomcat5.x + mysql
我所有的编码方式都是用的UTF-8
我只用了Strtus框架
在一个form中如下用的是post的提交方式:
<form class="form" action=&quo ......
SetGetPropertytest.jsp源代码如下,谢谢大家前来帮忙,同时祝大家中秋快乐
<%@ page c%>
<HTML>
<HEAD>
<TITLE>setProperty动作与getProperty动作范例 </TITLE> ......
<script language="javaScript">
function select()
{
document.selectpages.selectnum.value=document.selectpages.selectpage.value;
document.selectpages.submit();
}
&l ......