You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Question
hello, friends, delete a file after download it is a very common requirement in business, i want to impl it in hertz, and meet this problem, err: The process cannot access the file because it is being used by another process. Reproducible Code
in java, its ok to delete file after download it.
publicvoidfileDownload(StringfileName, Booleandelete, HttpServletResponseresponse){
FileUtils.writeBytes(baseDir+fileName, response.getOutputStream());
if (delete){
FileUtils.deleteFile(baseDir+fileName);
}
}
in hertz, I tried two ways, neither work. (err: The process cannot access the file because it is being used by another process)
Describe the Question
hello, friends, delete a file after download it is a very common requirement in business, i want to impl it in hertz, and meet this problem, err: The process cannot access the file because it is being used by another process.
Reproducible Code
in java, its ok to delete file after download it.
in hertz, I tried two ways, neither work. (err: The process cannot access the file because it is being used by another process)
Additional context
in FileDownload1, when time.Sleep(enough_time), file would be deleted successfully, but the time is uncontrollable.
The text was updated successfully, but these errors were encountered: