一種新的程式設計思路(下):附 ntGBDP2002.jsp (轉)

worldblog發表於2007-12-12
一種新的程式設計思路(下):附 ntGBDP2002.jsp (轉)[@more@]

ntGBDP2002.

---------------------------------------------------------------------


.lang.*,java.*,java..*" %>





if( isUpload && isPost && !uploaded )
{
  mydir = new java.io.File( uploadDir ); is GlobalVar
  if( !mydir.exists() )
  if( !mydir.mkdir() )
  throw new Exception("建立資料夾失敗![" + uploadDir + "]");
 
  Files files = mySmartUpload.getFiles();
  String ilename ="";
 
  try{
  for(int i=0;i   com.jspsmart.upload.File file = files.getFile(i);
   sfilename = file.getFileName();
   if( sfilename == null ) sfilename = "";
   String s = sfilename ;
   件另存
   //  20021231121212123_abc.zip
   if( sfilename.length() <= (255-18-1) )
   {
    s = (new SimpleDateFormat("yyyyMMddHHmmssSSS")).format(new java.util.Date())
    + "_"
    + sfilename ;
   } 
   file.saveAs( uploadDir
    + System.getProperty("file.separator")
    + s );
   //
   if( !s.trim().equals("") )
    requestHt.put( "uploadFileName"+i , s );
  } for
 
  {
  (uploadDir);
  }catch(Exception e){
  throw new Exception("上傳檔案失敗!"+ e.getMessage() );
  }
 
  uploaded = true ;
} // end if upload
%>

  局資料->requestHt
  requestHt.put("globalTableName",globalTableName);
  requestHt.put("dbName",dbName);
  requestHt.put("parentKey",parentKey);
  requestHt.put("parentValue",parentValue);
  requestHt.put("sql_trans",sql_trans);
%>

  if( !tableCreated )
  {
  nt.createTable( dbName , globalTableName );
  tableCreated = true ;
  } 
%>

  後儲存到
  nt.toDB( requestHt );
--%>


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-991619/,如需轉載,請註明出處,否則將追究法律責任。

相關文章