InputStream in ;
FormFile myFile ;
FileOutputStream fos ;
myFile = filmBean.getDyljpc(); //上傳文件
if (myFile != null) {
in = myFile.getInputStream();
fos = new FileOutputStream(filmTypePc); //上傳路徑
byte buffer[] = new byte[10240]; //開始向上傳路徑中剛建立的文件寫入數據,每次寫10KB字節
int count = 0;
while ((count = in.read(buffer)) > 0) {
fos.write(buffer, 0, count);
}
fos.flush();
fos.close();
myFile.destroy();
}