[Spring] 22. 게시물 상세/수정 - 파일 업로드/삭제 기능 추가
개발자가 되기까지 (2023.08.16~2024.04.15)/[Spring] Basic Web2024. 1. 21. 16:56[Spring] 22. 게시물 상세/수정 - 파일 업로드/삭제 기능 추가

detail.jsp // ... (기존 코드) ${fvo.fileName} ${fvo.fileSize }Byte 수정 삭제 목록 // ... (기존 코드) modify.jsp // ... (기존 코드) ${fvo.fileName} ${fvo.fileSize }Byte X 파일 업로드 수정 삭제 목록 boardFile.js // ... (기존 코드) document.addEventListener('click', (e)=>{ if(e.target.classList.contains('file-x')) { let uuid = e.target.dataset.uuid; removeFileToServer(uuid).then(result =>{ if(result == '1') { console.log("파일 삭제 성공..

개발자가 되기까지 (2023.08.16~2024.04.15)/[Spring] Basic Web2024. 1. 21. 01:57[Spring] 21. 게시물 등록 - 파일 업로드 기능 추가

register.jsp 글쓰기 // ... (기존 코드) 파일 업로드 등록 취소 boardFile.js document.getElementById('trigger').addEventListener('click', ()=>{ document.getElementById('files').click(); }); const regExp = new RegExp("\.(.exe|sh|bat|dll|jar|msi)$"); const maxSize = 1024 * 1024 * 20; function fileValidation(fileName, fileSize) { if(regExp.test(fileName)) { return 0; } else if (fileSize > maxSize) { return 0; } else ..

개발자가 되기까지 (2023.08.16~2024.04.15)/[Basic] Java2023. 11. 24. 20:22[Java] word.txt 파일로 출력할 수 있는 단어장 만들기

word.txt 파일로 출력할 수 있는 단어장 만들기 Word class : 단어 등록 클래스 - word, mean WordMain class - menu 1. 단어 등록 2. 단어 검색 3. 단어 수정 4. 단어장 출력 5. txt 파일로 출력 6. 종료 WordManager class - ArrayList public class Word { private K word; private V mean; public Word() {} public Word(K word, V mean) { this.word = word; this.mean = mean; } public K getWord() { return word; } public void setWord(K word) { this.word = word; } ..

개발자가 되기까지 (2023.08.16~2024.04.15)/[Basic] Java2023. 10. 16. 00:45[Java] BufferedReader, FileReader를 활용하여 단어장 만들기

import java.util.Objects; public class Word implements Comparable { //단어, 의미 //정렬 => Comparator 구현 객체 //기존클래스 + Comparable 구현 //정렬(equals 비교하여 정렬) //어떤값을 기준으로 정렬? private String word; private String mean; public Word() {} public Word(String word, String mean) { this.word = word; this.mean = mean; } public String getWord() { return word; } public void setWord(String word) { this.word = word; } pu..

개발자가 되기까지 (2023.08.16~2024.04.15)/[Basic] Java2023. 10. 16. 00:18[Java] File 클래스를 활용하여 파일 경로 추출

import java.io.File; public class FileObject { public static void main(String[] args) { File file = new File("C:\\Users\\folder1\\folder2\\JavaPractice\\JavaPractice\\out.txt"); // 파일명과 경로가 String 형태로 들어온다면... 구분 String fstr = file.toString(); System.out.println(fstr); System.out.println("--------------------------"); // fstr에서 드라이브만 추출 System.out.println("--드라이브만 추출--"); System.out.println(fstr..

728x90
반응형
image