ChuyênđềJ2EEnângcao http://sites.google.com/site/tinhuynhuit CHUYÊNĐỀJ2EENÂNGCAO BÀI TẬP THỰC HÀNH TUẦN UPLOAD FILE VÀ SEND EMAIL Nội dung Upload file 2 Web mail http://groups.google.com.vn/group/huflit_j2ee ChuyênđềJ2EEnângcao http://sites.google.com/site/tinhuynhuit Upload file y =” - / -d ” y y d y y y d phân - - -Trang upload.jsp y =” d” ” y d upload.jsp d d ChuyênđềJ2EEnângcao - y d d d - http://sites.google.com/site/tinhuynhuit d d y d d upload.jsp http://groups.google.com.vn/group/huflit_j2ee d ChuyênđềJ2EEnângcao - http://sites.google.com/site/tinhuynhuit y d d d d d ) ChuyênđềJ2EEnângcao http://sites.google.com/site/tinhuynhuit Web mail - d - - yd d” MailSender http://groups.google.com.vn/group/huflit_j2ee y d ChuyênđềJ2EEnângcao - d http://sites.google.com/site/tinhuynhuit ChuyênđềJ2EEnângcao http://sites.google.com/site/tinhuynhuit U = m_totalBytes) break; if(arr[searchPos] == (byte)m_boundary.charAt(keyPos)){ if(keyPos == boundaryLen - 1){ m_endData = ((searchPos - boundaryLen) + 1) - 2; break; } searchPos++; keyPos++; } else{ searchPos++; keyPos = 0; } } while(true); // Here m_startData and m_endData is what we need http://groups.google.com.vn/group/huflit_j2ee */ ChuyênđềJ2EEnângcao http://sites.google.com/site/tinhuynhuit //Get file name String filename =dataHeader.substring(dataHeader.indexOf("filename=\"")+10); filename = filename.substring(0,filename.indexOf("\n")); filename = filename.substring(filename.lastIndexOf("\\")+1,filename.indexOf("\"")); String dir="C:/jakarta-tomcat-4.1.27/webapps/webmail/data/"; //Now try to write output file here FileOutputStream fos; fos = new FileOutputStream(dir+filename); for (int n=m_startData; n Website lý thuyết: http://sites.google.com/site/tinhuynhuit/courses/developenterprise-application-with-jee Group thực hành: https://groups.google.com/forum/?hl=vi#!forum/huflit_j2ee