From 3b88984af5c061d9003593e19b00ee4afcca9e74 Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Tue, 30 Apr 2024 11:00:09 +0200 Subject: [PATCH 1/6] Update hint for big file upload --- dspace/config/submission-forms.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dspace/config/submission-forms.xml b/dspace/config/submission-forms.xml index 0acba1b87086..304d8d0cb076 100644 --- a/dspace/config/submission-forms.xml +++ b/dspace/config/submission-forms.xml @@ -393,10 +393,10 @@ onebox - The actual maximum upload size of the file is 4GB. To upload the file bigger than maximum - upload size type the URL of that big file. Admin must know URL to that bitstream file. - Then click on the 'Save' button and the file will start to upload. The file will be loaded - from the '/temp' folder of the server. Example: /tomcat/temp/bitstream.png + The actual maximum upload size of the file is 4GB. To upload a file bigger than the + maximum upload size, enter the URL of that large file. The admin must know the URL + of that bitstream file. Then, click on the 'Save' button, and the file will start + to upload. The file path must be an absolute path. From e13cc0b547bb6b8a4338d107c55cbef81adee7ed Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Tue, 30 Apr 2024 11:48:53 +0200 Subject: [PATCH 2/6] Do not delete big file after upload by default - changed cfg property. --- dspace/config/clarin-dspace.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace/config/clarin-dspace.cfg b/dspace/config/clarin-dspace.cfg index c6f9552ffb2b..ff3a44805085 100644 --- a/dspace/config/clarin-dspace.cfg +++ b/dspace/config/clarin-dspace.cfg @@ -64,8 +64,8 @@ lr.help.mail = test@test.sk lr.help.phone = 0000 # Admin could upload the file bigger than maximum upload size. -# Should be this big file deleted from the '/temp' folder? -delete.big.file.after.upload = true +# Should be this big file deleted from where it was uploaded? +delete.big.file.after.upload = false ##### BITSTREAM DOWNLOAD ##### From 21e0c5694bd6206c76754f521cd6c25801cb3fbf Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Tue, 30 Apr 2024 11:50:46 +0200 Subject: [PATCH 3/6] Refactored checking if the file should be deleted after upload. --- .../app/rest/repository/WorkspaceItemRestRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemRestRepository.java index 3add833152e9..644aa654f7f6 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/WorkspaceItemRestRepository.java @@ -467,8 +467,8 @@ private void uploadFileFromURL(Context context, HttpServletRequest request, Inte wis.update(context, witem); // delete file - String shouldDeleteFile = configurationService.getProperty("delete.big.file.after.upload"); - if (StringUtils.isNotBlank(shouldDeleteFile) && StringUtils.equals("true", shouldDeleteFile)) { + boolean shouldDeleteFile = configurationService.getBooleanProperty("delete.big.file.after.upload", false); + if (shouldDeleteFile) { FileUtils.forceDelete(file); } } From 661715239fa0e123b5b3d8a989f7c0995183c7d9 Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Tue, 30 Apr 2024 13:11:41 +0200 Subject: [PATCH 4/6] bigfile url removed from traditionalpageone form --- dspace/config/submission-forms.xml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/dspace/config/submission-forms.xml b/dspace/config/submission-forms.xml index 304d8d0cb076..1e3d26ba9142 100644 --- a/dspace/config/submission-forms.xml +++ b/dspace/config/submission-forms.xml @@ -384,26 +384,6 @@ - - - local - bitstream - redirectToURL - false - - onebox - - The actual maximum upload size of the file is 4GB. To upload a file bigger than the - maximum upload size, enter the URL of that large file. The admin must know the URL - of that bitstream file. Then, click on the 'Save' button, and the file will start - to upload. The file path must be an absolute path. - - - - policy=deny,action=read,grantee-type=user,grantee-id=* - - -