📄 upload.jsp
字号:
<%@ page contentType="text/html;charset=GBK"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ page import="java.util.*"%>
<%
ArrayList backq=new ArrayList();
String efix= "";
String filename= "";
String bbs_type= "";
backq = (ArrayList)request.getAttribute("backQ");
if(backq != null)
{
for(Iterator it = backq.iterator(); it.hasNext();)
{
HashMap map =(HashMap)it.next();
//if(map.get("EFIX") != null)
//{
// efix=map.get("EFIX").toString();
//}
if(map.get("FILENAME") != null)
{
filename=map.get("FILENAME").toString();
}
}
}
HttpSession tempsession = request.getSession();
String cust_id="";
cust_id =(String)tempsession.getAttribute("SESSION_CUST_ID");
String user_id="";
user_id =(String)tempsession.getAttribute("SESSION_USER_ID");
%>
<html>
<head>
<script language="javascript">
function tests()
{
var length,fileString,fileName,x,user_id;
fileString=document.all.files.value;
user_id = document.all.user_id_now.value;
if(fileString == "")
{
return; //没有选择文件,则返回。
}
length=fileString.length;
x=fileString.lastIndexOf("\\");
x++;
fileName=fileString.substring(x,length);
document.all.filename.value = fileName;
parent.d_fromurl.value = document.all.attach_root_id.value;
alert("开始上传文件!");
}
function efix()
{
var efix,upfilepath;
efix=document.all.efixq.value;
if (document.all.efixq.value != "")
{
parent.efix.value = efix;
}
upfilepath = document.all.upfile.value;
parent.d_fromurl.value = upfilepath;
alert("图片信息发布成功!");
}
</script>
</head>
<body>
<html:form action="/addFileinfo.do" enctype="multipart/form-data">
<input name="SESSION_CUST_ID" type="hidden" value=<%=cust_id%> />
<input name="SESSION_USER_ID" type="hidden" value=<%=user_id%> />
<input name="attach_root_id" id="attach_root_id" type="hidden" />
<input name="trade_type_code" type="hidden" value="0300"/>
<%
if(backq == null)
{
%>
<html:file property="files"/><html:errors property="files"/>
<select name=file_type>
<option value="0">原尺寸图片</option>
<option value="C">模特标题列表图片(120*160)</option>
<option value="A">标题缩略图片(60*60)</option>
<option value="B">标题缩略图片(120*120)</option>
</select>
<input type=submit value="上传至服务器" onclick="tests()">
<%
}
else
{
out.print("图片上传成功,点击发布图片按钮发布到网站!");
}
%>
<input type=button value="发布图片到网站" onclick="efix()">
<input name="filename" type="hidden"/>
<input name="efixq" type="hidden" value="<%=efix%>"/>
<input name="upfile" type="hidden" value="<%=filename%>"/>
<input name="user_id_now" type="hidden" value="<%=user_id%>"/>
</html:form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -