String Msg = null;
long MaxFileSize = 1000000;
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
String filename = "";
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(0);
// List msglist = new ArrayList(); -V1.0.6
java.io.File pkg;
//List errLine = new ArrayList();
//List fileList = new ArrayList();
ErrorMessage err = null;
if (myFile.getSize() < MaxFileSize) {
if (!myFile.isMissing()) {
pkg = new File(getServletContext().getRealPath("/")
+ "\\uploadtmp");
if (!pkg.isDirectory())
pkg.mkdir();
filename = getServletContext().getRealPath("/")
+ "\\uploadtmp\\" + myFile.getFileName();
myFile.saveAs(filename,com.jspsmart.upload.SmartUpload.SAVE_PHYSICAL);
// 用户上传的数据文件已经保存在了临时文件夹中
大概是这样 LZ参考一下
long MaxFileSize = 1000000;
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
String filename = "";
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(0);
// List msglist = new ArrayList(); -V1.0.6
java.io.File pkg;
//List errLine = new ArrayList();
//List fileList = new ArrayList();
ErrorMessage err = null;
if (myFile.getSize() < MaxFileSize) {
if (!myFile.isMissing()) {
pkg = new File(getServletContext().getRealPath("/")
+ "\\uploadtmp");
if (!pkg.isDirectory())
pkg.mkdir();
filename = getServletContext().getRealPath("/")
+ "\\uploadtmp\\" + myFile.getFileName();
myFile.saveAs(filename,com.jspsmart.upload.SmartUpload.SAVE_PHYSICAL);
// 用户上传的数据文件已经保存在了临时文件夹中
大概是这样 LZ参考一下
具体用法网上很多教程!
jspsmartupload机制不好,它是把文件上传完毕在进行处理,包括决定是否接受等等,效率很低。
而且jspsmartupload早已停止开发。