81,092
社区成员
发帖
与我相关
我的任务
分享
if((String)session.getAttribute("userID")!=null&&(String)session.getAttribute("schoolID")=="2"){
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
MultipartRequest theMultipartRequest=new MultipartRequest(request,"D:\\weike video\\",20*1024*1024,"UTF-8");
Enumeration theEnumeration=theMultipartRequest.getFileNames();
int fileCount=0;
while(theEnumeration.hasMoreElements()){
//fileCount++;
String fieldName=(String)theEnumeration.nextElement();
String fileName=theMultipartRequest.getFilesystemName(fieldName);
String contentType=theMultipartRequest.getContentType(fieldName);
File theFile=theMultipartRequest.getFile(fieldName);
String videoName=theMultipartRequest.getParameter("videoName");
String videoAuthor=theMultipartRequest.getParameter("videoAuthor");
String videoPath=theFile.getAbsolutePath();
//theFile.getAbsolutePath();
String schoolID=theMultipartRequest.getParameter("schoolID");
dbCon.createConnection();
dbCon.updateData(videoName,videoAuthor,videoPath,schoolID);