Skip to content

Commit a7eb36b

Browse files
committed
Review changes
1 parent d99d70f commit a7eb36b

File tree

4 files changed

+64
-12
lines changed

4 files changed

+64
-12
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Electrophysiology Uploader
2+
3+
## Purpose
4+
5+
The electrophysiology uploader is intended to allow users to upload and browse electrophysiology files.
6+
7+
8+
## Intended Users
9+
10+
The primary users are EEG technicians or site coordinators uploading EEG recordings
11+
for registered LORIS candidates and timepoints.
12+
13+
## Scope
14+
15+
The electrophysiology uploader has the following built-in capabilities to facilitate
16+
timely eeg insertion into the LORIS database. Specifically, it allows to browse
17+
uploaded recordings using the `Browse` tab and upload recordings using the `Upload`
18+
tab.
19+
20+
EEG recordings can be reuploaded multiple times. Previous upload attempts will be backup in _EEGUploadIncomingPath_/archives/.
21+
22+
## Permissions
23+
24+
#### Module Permission
25+
26+
Permission `electrophysiology_browser_view_allsites` or `electrophysiology_browser_view_site`
27+
is necessary to have access to the module and gives the user the ability to
28+
upload and browse all recordings uploaded to the database.
29+
30+
#### Filesystem Permission
31+
32+
The path on the filesystem where the uploaded file go (_EEGUploadIncomingPath_) should be
33+
readable and writable by the web server.
34+
35+
## Configurations
36+
37+
The electrophysiology uploader has the following configurations that affect its usage:
38+
39+
### Install Configurations
40+
41+
To enable the module to handle large files, please follow the
42+
instructons for [Handling Large File Uploads](../../docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/02_Website_Configuration/Handling_Large_File_Uploads.md).
43+
44+
#### <a name="database_config_link"></a> Database Configurations
45+
46+
EEGUploadIncomingPath - This setting determines where on the filesystem the
47+
uploader is to place the uploaded recordings.
48+
**Note**: Uploaded recordings are erased from the
49+
`EEGUploadIncomingPath` following a successful archival and insertion
50+
through the LORIS-MRI pipeline.
51+

modules/electrophysiology_uploader/jsx/UploadViewer.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,12 @@ export default function UploadViewer(props) {
7777
];
7878

7979
return (
80-
<>
81-
<FilterableDataTable
82-
name='eeg_upload_viewer'
83-
data={props.data}
84-
fields={fields}
85-
getFormattedCell={formatColumn}
86-
/>
87-
</>
80+
<FilterableDataTable
81+
name='eeg_upload_viewer'
82+
data={props.data}
83+
fields={fields}
84+
getFormattedCell={formatColumn}
85+
/>
8886
);
8987
}
9088

modules/electrophysiology_uploader/php/electrophysiology_uploader.class.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Electrophysiology_Uploader extends \DataFrameworkMenu
5050
*/
5151
public function useProjectFilter(): bool
5252
{
53-
return false;
53+
return true;
5454
}
5555

5656
/**

modules/electrophysiology_uploader/php/upload.class.inc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ class Upload extends \NDB_Page
125125
if (empty($request->getUploadedFiles()) && empty($values)) {
126126
$upload_max_size = \Utility::getMaxUploadSize();
127127
return new \LORIS\Http\Response\JSON\InternalServerError(
128-
"The uploaded file size ($upload_max_size) exceeds " .
129-
"the upload_max_filesize or post_max_size directive in php.ini"
128+
"The uploaded file size exceeds the upload_max_filesize " .
129+
"or post_max_size directive in php.ini ($upload_max_size)"
130130
);
131131
}
132132

@@ -176,7 +176,10 @@ class Upload extends \NDB_Page
176176
);
177177
}
178178

179-
// Check for existing files
179+
// Check for an existing file
180+
// If found, add a timestamp suffix to avoid collision
181+
// with any other existing upload attempt
182+
// and move the renamed file in _EEGUploadIncomingPath_/archives/
180183
$targetPath = $targetdir->getPathname() . '/' . $filename;
181184
if (file_exists($targetPath)) {
182185
$archiveFilename = str_replace(

0 commit comments

Comments
 (0)