WAP上传图片代码
来源:互联网 发布:ug四轴加工编程步骤 编辑:程序博客网 时间:2024/06/06 11:01
<?xml version= "1.0 " encoding= 'utf-8 '?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN "
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " xml:lang= "en " lang= "en ">
<head>
<meta http-equiv= "content-type " content= "application/vnd.wap.xhtml+xml;charset=UTF-8 "/>
<title> 文件上传 </title>
</head>
<body>
<form name= "form1 " method= "post " action= "up.jsp " enctype= "multipart/form-data ">
密码: <input type= "text " name= "pass "/> <br/>
<input type= "file " name= "file1 "/>
<input type= "submit " name= "submit " value= "· 提交 · "/>
</form>
</body>
</html>
---------------------------------------------
<%@ page import= "org.apache.commons.fileupload.FileItem " %>
<%@ page import= "org.apache.commons.fileupload.servlet.ServletRequestContext " %>
<%@ page import= "java.io.File " %>
<%@ page contentType= "text/vnd.wap.wml;charset=UTF-8 " language= "java " %>
<jsp:useBean id= "fUpload " scope= "page " class= "org.apache.commons.fileupload.FileUpload "/>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN " "http://www.wapforum.org/DTD/wml_1.1.xml ">
<wml>
<card>
<p>
<%
try {
String path = request.getSession().getServletContext().getRealPath( "/ ");
out.println(path);
out.println(request.getParameterMap());
fUpload.setSizeMax(1000000);
out.println( "hi.nihao1 ");
fUpload.setFileItemFactory(new org.apache.commons.fileupload.disk.DiskFileItemFactory());
out.println( "hi.nihao2 ");
java.util.List items = fUpload.parseRequest(new ServletRequestContext(request));
out.println( "hi.nihao3 ");
FileItem fi = (FileItem) items.get(1);
out.println( "hi.nihao4 ");
File uploadFile = new File(path+ "/ "+fi.getName());
out.println( "hi.nihao5 ");
fi.write(uploadFile);
out.println( "hi.nihao6 ");
out.println(request.getSession().getServletContext().getRealPath( "/ "));
} catch (Exception ex) {
ex.printStackTrace(System.out);
out.println( "ERROR~! "+ex);
}
%>
</p>
</card>
</wml>
- WAP上传图片代码
- WAP上传图片代码
- WAP页上传图片
- wap端图片上传
- 用.net做wap想实现图片上传
- 图片上传代码示例
- 图片上传代码参考。
- 上传图片代码
- 上传文件,图片代码
- PHP图片上传代码
- PHP图片上传代码
- 图片文件上传代码
- 图片上传模块代码
- 上传图片代码
- 上传图片代码
- fileUpload上传图片代码
- java上传图片代码
- jsp图片上传代码
- Asterisk的Callback功能
- c# treeview 递归生成树
- 自由职业者的必备素质,想做SOHO族的朋友必看!
- mysql的c++封装类
- sqlserver常用函数/存储过程/数据库角色
- WAP上传图片代码
- Asp.net页面传递参数的几种方法对比讲解
- 在Eclipse中加入Android源码
- Linux下安装OpenSSL练手文档
- _beginthreadex 实践小结
- 将一个datatable序列化和压缩
- ASP.NET服务器控件使用之GridView
- 软件测试框架——自动化测试框架(专题)
- 12864液晶显示问题