Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to postflat modethreaded modego to previous topicgo to next topicgo to back
作者 jspSmart上传和下载的问题
kkk





发贴: 12
于 2006-05-31 15:11 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,com.jspsmart.upload.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="mySmartupload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>上传文件</title>
</head>

<body>
<div align="center">
<p>文件上传
</p>
<hr>
<%
   int count=0;
   String destin="d:/tt";
   mySmartupload.initialize(pageContext);
   mySmartupload.upload();
   out.println(1);
String content=mySmartupload.getRequest().getParameter( "text1" );
   out.println(content);
   out.println(2);
   for(int i=0;i<mySmartupload.getFiles().getCount();i++)
   {
   out.println(3);
   com.jspsmart.upload.File myFile = mySmartupload.getFiles().getFileLight Bulb;
   if(!myFile.isMissing())
   {
    out.println(4);
     myFile.saveAs(destin+myFile.getFileName());
     out.println( " 文件名称"+myFile.getFieldName()+"<br>");
out.println( "文件大小 "+myFile.getSize()+"<br>");
out.println( "文件名称 "+myFile.getFileName()+"<br>");
out.println( "文件扩展名 "+myFile.getFileExt()+"<br>");
out.println( "文件大小 "+myFile.getFilePathName()+"<br>");
out.println( "文件路径 "+myFile.getFilePathName()+"<br>");
out.println( "文件类型 "+myFile.getContentType()+"<br>");
out.println( "contentdisp "+myFile.getContentDisp()+"<br>");
out.println( "MIME类型 "+myFile.getTypeMIME()+"<br>");

out.println( " </TABLE><BR> " );
      }
    }
%>
</div>
</body>
</html>
不知为什么,它实现不了上传功能,能不能帮忙看看呀???它是哪里出错了.




致JAVA初学者+如何下手学JAVA

话题树型展开
人气 标题 作者 字数 发贴时间
2331 jspSmart上传和下载的问题 kkk 1723 2006-05-31 15:11
1912 Re:jspSmart上传和下载的问题 chengbd 1679 2006-06-02 02:42
1948 Re:jspSmart上传和下载的问题 chengbd 70 2006-06-02 02:44
2044 Re:jspSmart上传和下载的问题 kkk 56 2006-06-22 15:07

reply to postflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923