Skip to content

Commit

Permalink
Merge pull request #10867 from IQSS/10667-primefaces-upload-temp-files
Browse files Browse the repository at this point in the history
Temp file cleanup for PrimeFaces uploads 10667
  • Loading branch information
pdurbin authored Sep 20, 2024
2 parents 1d31fb0 + bcdf332 commit 4de0e75
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -2092,6 +2092,12 @@ public void handleFileUpload(FileUploadEvent event) throws IOException {
errorMessages.add(cex.getMessage());
uploadComponentId = event.getComponent().getClientId();
return;
} finally {
try {
uFile.delete();
} catch (IOException ioex) {
logger.warning("Failed to delete temp file uploaded via PrimeFaces " + uFile.getFileName());
}
}
/*catch (FileExceedsMaxSizeException ex) {
logger.warning("Failed to process and/or save the file " + uFile.getFileName() + "; " + ex.getMessage());
Expand Down

0 comments on commit 4de0e75

Please sign in to comment.