From b9a71b6616534037e7aed01f09a43465bf858270 Mon Sep 17 00:00:00 2001 From: Laetitia Fesselier Date: Tue, 4 Apr 2023 14:43:20 -0400 Subject: [PATCH] Review changes --- .../electrophysiology_uploader/jsx/UploadViewer.js | 14 ++++++-------- .../php/electrophysiology_uploader.class.inc | 2 +- .../php/upload.class.inc | 9 ++++++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/electrophysiology_uploader/jsx/UploadViewer.js b/modules/electrophysiology_uploader/jsx/UploadViewer.js index bd34b379fbb..a1000eeae5e 100644 --- a/modules/electrophysiology_uploader/jsx/UploadViewer.js +++ b/modules/electrophysiology_uploader/jsx/UploadViewer.js @@ -77,14 +77,12 @@ export default function UploadViewer(props) { ]; return ( - <> - - + ); } diff --git a/modules/electrophysiology_uploader/php/electrophysiology_uploader.class.inc b/modules/electrophysiology_uploader/php/electrophysiology_uploader.class.inc index fc744132ae4..321867fc60d 100644 --- a/modules/electrophysiology_uploader/php/electrophysiology_uploader.class.inc +++ b/modules/electrophysiology_uploader/php/electrophysiology_uploader.class.inc @@ -50,7 +50,7 @@ class Electrophysiology_Uploader extends \DataFrameworkMenu */ public function useProjectFilter(): bool { - return false; + return true; } /** diff --git a/modules/electrophysiology_uploader/php/upload.class.inc b/modules/electrophysiology_uploader/php/upload.class.inc index f11d6519891..3f649e454ec 100644 --- a/modules/electrophysiology_uploader/php/upload.class.inc +++ b/modules/electrophysiology_uploader/php/upload.class.inc @@ -125,8 +125,8 @@ class Upload extends \NDB_Page if (empty($request->getUploadedFiles()) && empty($values)) { $upload_max_size = \Utility::getMaxUploadSize(); return new \LORIS\Http\Response\JSON\InternalServerError( - "The uploaded file size ($upload_max_size) exceeds " . - "the upload_max_filesize or post_max_size directive in php.ini" + "The uploaded file size exceeds the upload_max_filesize " . + "or post_max_size directive in php.ini ($upload_max_size)" ); } @@ -176,7 +176,10 @@ class Upload extends \NDB_Page ); } - // Check for existing files + // Check for an existing file + // If found, add a timestamp suffix to avoid collision + // with any other existing upload attempt + // and move the renamed file in _EEGUploadIncomingPath_/archives/ $targetPath = $targetdir->getPathname() . '/' . $filename; if (file_exists($targetPath)) { $archiveFilename = str_replace(