Skip to content

Commit

Permalink
fix: temp folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiinaKin committed May 10, 2024
1 parent 2b2e892 commit aaa9686
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class TypechoController(

@PostMapping("/upload")
fun uploadTypechoFile(@RequestPart("file") file: Mono<FilePart>): Mono<Result<String>> {
val tempFile = File("temp")
tempFile.mkdir()
val uploadFile = File("temp/", System.currentTimeMillis().toString() + "")
val unCompressedFile = File("temp/", System.currentTimeMillis().toString() + "unz")
uploadFile.createNewFile()
Expand All @@ -57,6 +59,7 @@ class TypechoController(
try {
FileUtils.delete(uploadFile)
FileUtils.deleteDirectory(unCompressedFile)
FileUtils.deleteDirectory(tempFile)
logger.info { "unzTemp file deleted: true" }
} catch (e: IOException) {
logger.error { "unzTemp file deleted: false" }
Expand Down

0 comments on commit aaa9686

Please sign in to comment.