文件名称:jsp编程关于上传下载设计
文件大小:64KB
文件格式:DOC
更新时间:2013-01-30 14:04:05
上传下载
<%@ page language="java" import="com.jspsmart.upload.*"%>
jspSmartUpload : Sample 2
<% String name = (String) session.getValue("username"); // Variables int count=0; // Initialization mySmartUpload.initialize(pageContext); // Upload mySmartUpload.upload(); // Select each file for (int i=0;i
"); out.println("FileName = " + myFile.getFileName() + "
"); out.println("FileExt = " + myFile.getFileExt() + "
"); out.println("FilePathName = " + myFile.getFilePathName() + "
"); out.println("ContentType = " + myFile.getContentType() + "
"); out.println("ContentDisp = " + myFile.getContentDisp() + "
"); out.println("TypeMIME = " + myFile.getTypeMIME() + "
"); out.println("SubTypeMIME = " + myFile.getSubTypeMIME() + "
"); String FileName="../upload/"+myFile.getFileName(); String strSQL="update guestbook set filename='" + FileName + "' where name='"+ name +"'"; updateBean.executeUpdate(strSQL); count ++; } } // Display the number of files which could be uploaded out.println("
" + mySmartUpload.getFiles().getCount() + " files could be uploaded.
"); // Display the number of files uploaded out.println(count + " file(s) uploaded."); %> <% %> Top