커밋3. 윈도우 시스템에서도 업로드 시 Temp폴더의 delete file 에러방지코드 추가

This commit is contained in:
kimilguk
2023-06-06 13:24:39 +09:00
parent b2adbc1079
commit 3af8a46d83

View File

@@ -191,8 +191,9 @@ public class FileStorageUtils implements StorageUtils {
Path path = getStorePath(basePath); Path path = getStorePath(basePath);
Path target = path.resolve(filename); Path target = path.resolve(filename);
Files.copy(file.getInputStream(), target, StandardCopyOption.REPLACE_EXISTING); InputStream inputStream = file.getInputStream();
Files.copy(inputStream, target, StandardCopyOption.REPLACE_EXISTING);
inputStream.close(); //윈도우 시스템에서도 업로드 시 Temp폴더의 delete file 에러방지코드 추가
return filename; return filename;
} catch (IOException ex) { } catch (IOException ex) {
log.error("Could not stored file", ex); log.error("Could not stored file", ex);