int count=0;
// Initialization
mySmartUpload.initialize(pageContext);
// Upload
mySmartUpload.upload();
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(0);
String strExt = mySmartUpload.getFiles().getFile(0).getFileExt();
java.text.SimpleDateFormat simpleDateFormat = new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS");//取系统时间,精确到毫秒。
java.util.Date date = new java.util.Date();
String strTime = simpleDateFormat.format(date);
String strFileName = strTime + "." + strExt;
String FilePath = uploadpath+strFileName;//uploadpath为保存目录名。
try
{
//count = mySmartUpload.save(uploadpath);
myFile.saveAs(FilePath);
}
catch (Exception e)
{
out.println(e.toString());
}
// Initialization
mySmartUpload.initialize(pageContext);
// Upload
mySmartUpload.upload();
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(0);
String strExt = mySmartUpload.getFiles().getFile(0).getFileExt();
java.text.SimpleDateFormat simpleDateFormat = new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS");//取系统时间,精确到毫秒。
java.util.Date date = new java.util.Date();
String strTime = simpleDateFormat.format(date);
String strFileName = strTime + "." + strExt;
String FilePath = uploadpath+strFileName;//uploadpath为保存目录名。
try
{
//count = mySmartUpload.save(uploadpath);
myFile.saveAs(FilePath);
}
catch (Exception e)
{
out.println(e.toString());
}