1. Mysql에 단문 넣기
2. Source targe으로 DB만들어서 following 정보 입력
1. Mysql에 단문 넣기
2. Source targe으로 DB만들어서 following 정보 입력
아무 생각없이 7을 다시 깐게 문제 ㅠ.ㅠ
1. 파일패스 컬럼에 내용이 있는 경우는 written time 위에
파일명 : [파일명] 이와 같이 나온다.
2. apache commons 사용
3. 한글 파일명 지원 안함. 그냥 다운 받을때 정해도 되는 문제라;
4. board의 id값을 getMessage로 넘김.
5. 파일이 다운로드 되고 돌아오는 페이지는 우선 첫번째 페이지
전체화면후, 파일다운로드후 돌아오는 페이지에 관한 것은 추후 기능 추가.
import java.io.*;
public class CopyFileIOversion{
private static void copyfile(String srFile, String dtFile){
try{
File f1 = new File(srFile);
File f2 = new File(dtFile);
InputStream in = new FileInputStream(f1);
//For Overwrite the file.
OutputStream out = new FileOutputStream(f2);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0){
out.write(buf, 0, len);
}
in.close();
out.close();
System.out.println("File copied.");
}
catch(FileNotFoundException ex){
System.out.println(ex.getMessage() + " in the specified directory.");
System.exit(0);
}
catch(IOException e){
System.out.println(e.getMessage());
}
}
public static void main(String[] args){
long start=System.currentTimeMillis();
copyfile("D:/Downloads/totodisk/BestProf/080324.avi","c:/bbd.avi");
System.out.println((System.currentTimeMillis() - start)/1000);
}
}