国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

SmartUpload在servlet中使用方法

2024-07-21 02:15:06
字體:
來源:轉載
供稿:網友
,歡迎訪問網頁設計愛好者web開發。smartupload mysmartupload = new smartupload();

mysmartupload.initialize(servlet.getservletconfig(), request,response);

// 設定上傳限制

// 1.限制每個上傳文件的最大長度。

// mysmartupload.setmaxfilesize(10000);

// 2.限制總上傳數據的長度。

// mysmartupload.settotalmaxfilesize(20000);

// 3.設定允許上傳的文件(通過擴展名限制),僅允許doc,txt文件。

// mysmartupload.setallowedfileslist("doc,txt");

// 4.設定禁止上傳的文件(通過擴展名限制),禁止上傳帶有exe,bat, jsp,htm,html擴展名的文件和沒有擴展名的文件。

// mysmartupload.setdeniedfileslist("exe,bat,jsp,htm,html,,");

mysmartupload.upload();

//讀取其它數據

request req = mysmartupload.getrequest();

string title = req.getparameter("title");

//保存文件

for (int i = 0; i < mysmartupload.getfiles().getcount(); i++) {

com.jspsmart.upload.file file = mysmartupload.getfiles().getfile(i);

if (file.ismissing()) continue;

file.saveas(savepath + file.getfilename());

}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 原阳县| 赤水市| 布尔津县| 潜山县| 酒泉市| 会东县| 黄龙县| 遂溪县| 西宁市| 通州区| 远安县| 瓦房店市| 平顶山市| 固安县| 巴彦县| 余姚市| 靖州| 勐海县| 韶关市| 股票| 清镇市| 芜湖市| 桑日县| 淅川县| 额敏县| 定安县| 雅江县| 铁岭县| 连江县| 盐边县| 温泉县| 龙井市| 南阳市| 太仓市| 宣武区| 昭通市| 沽源县| 茶陵县| 大厂| 阿尔山市| 张家口市|