| <controller maxFileSize=”2M” tempDir=”d:/temp”/> |
然后只要在form中加上enctype="multipart/form-data" 就可以實(shí)現struts的上傳了,十分簡(jiǎn)單吧?
下面我們在數據庫中建立一張表。
| create sequence Attachment_seq; DROP TABLE ATTACHMENT; create table Attachment ( AttachID INT not null, --自動(dòng)增長(cháng)號 AttachFilename VARCHAR2(250) null, --文件名 AttachFileSize INT not null, --文件大小 AttachMimeType VARCHAR2(70) null, --文件類(lèi)型 AttachDesc VARCHAR2(250) null, --說(shuō)明 AttachCreationIP VARCHAR2(20) not null, --上傳的IP AttachCreationDate TIMESTAMP not null, --創(chuàng )建時(shí)間 AttachModifiedDate TIMESTAMP not null, --文件保存路徑 ATTACHFILEPATH VARCHAR2 (250) NOT NULL, primary key (AttachID) ); create or replace trigger Attach_trig_autoinc before insert on Attachment for each row begin if (:new.AttachID is null) then select Attachment_seq.nextval into :new.AttachID from dual; end if; end; |
字段的內容都很簡(jiǎn)單。
下面建立ibatis的SQL map文件。建立標準的insert、update、delete和find的SQL。相信看過(guò)前面系列文章的朋友對此已經(jīng)很熟悉了。
(未完待續)聯(lián)系客服