# Using the Resource File Quarantine

The Resource File Quarantine, or "Triage" for custom resource uploads, provides the ability for project owners to review and approve resource file uploads before they hit your file system.

This feature is hidden by default in XNAT, and must be enabled in your project along with the Custom Resource Uploader feature in order to be used. See Enabling Project Features for details.

## Defining a Resource File Quarantine Location

Site administrators must define a file system location for quarantined resource uploads before this feature can be used. Depending on how high-risk they perceive these files to be, they may want to designate a separate server for these quarantined uploads to live in. See XNAT File System Settings for details.

## Requiring Resource Uploads to be Quarantined

When a project owner defines a new Custom Resource Uploader, they can specify "Require Quarantine" as an option. This will route all resource files uploaded via this uploader to the Resource Quarantine or "Triage" location. From here, only a Project Owner or site administrator can review and determine whether to accept the files or remove them.

When "Force Quarantine" is selected, the ability to trigger an automated script on upload and the ability to specify a subfolder become disabled. Also, ZIP uploads will not automatically be unpacked.

When a user uploads a new resource file using this kind of configuration, a note will be displayed in the UI, telling users that their files will be uploaded to a project quarantine.

## Reviewing Resource Uploads in the File Quarantine

When the "Quarantine Review" feature has been enabled in your project, Project Owners will see a new tab at the top of their project labeled "Quarantine". It will have a series of entries in it for each user upload to each data object in your project.

Note the third entry in the screenshot above. If a user uploads multiple files to a single subject or experiment, all of those files are triaged together – i.e. the project owner cannot accept or reject them on a file-by-file basis using the UI. However, each file can be individually managed via the API.

Within the Quarantine panel, for each set of uploaded files to triage, a set of actions can be taken.

• Remove - Removes the selected upload from the resource quarantine, effectively cancelling the user's upload attempt
• Approve - Approves the selected upload, and triggers XNAT to move the resource files from the quarantine to the selected resource location

If you choose to download the resource set, you will also receive a ".manifest" file that contains provenance related to the upload. For example:

{
"properties": [
{
"TARGET": "/data/archive/experiments/XNAT_E00006/resources/DOCS/files",
"DATE": "2021-04-19 21:34:05",
"FTARGET": "<b>Session</b>: 50_CT_1<br><b>Resource</b>: DOCS",
"OVERWRITE": "false",
"Resource": "/data/services/triage/projects/AbCTSeg/resources/1618868036316/files/activity(1).csv",
"format": "",
"USER": "chuckc",
"URI": "/data/services/triage/projects/AbCTSeg/resources/1618868036316/files/activity(1).csv",
"content": "",
"EVENT_REASON": ""
},
{
"TARGET": "/data/archive/experiments/XNAT_E00006/resources/DOCS/files",
"DATE": "2021-04-19 21:34:08",
"FTARGET": "<b>Session</b>: 50_CT_1<br><b>Resource</b>: DOCS",
"OVERWRITE": "false",
"Resource": "/data/services/triage/projects/AbCTSeg/resources/1618868036316/files/activity(2).csv",
"format": "",
"USER": "chuckc",
"URI": "/data/services/triage/projects/AbCTSeg/resources/1618868036316/files/activity(2).csv",
"content": "",
"EVENT_REASON": ""
}
]
}

Included in this manifest is a set of REST URIs that allows you to take direct action on each resource file uploaded to the triage space.

## Using the Triage API

The XNAT API Documentation has guidance on using the Resource Quarantine / Triage API. See Resource Quarantine API