The File Transfer module requires significant customization by a developer and is not included in standard LabKey distributions. Developers can find the source code in the LabKey GitHub repository
. Please contact LabKey
to inquire about support options.
The File Transfer module provides a way to interact with large files not actually stored on LabKey Server, but on a Globus endpoint. Users can view and initiate downloads of the Globus-based files using the LabKey Server user interface. The LabKey Server interface provides basic metadata about each file, and whether the file is available for download.
Set Up Globus
This step configures Globus to allow LabKey Server to obtain Globus authentication codes, which can be traded for access tokens with which LabKey Server can initiate transfers.
- Redirects: You must specify a redirect URL that the application will use when making authorization and token requests. These redirect URLs are required and must match the URLs provided in the requests. This should be set to the filetransfer-tokens.view URL for your server, without any project/folder container specified (see the example below). The ending ? is required. Even though Globus says https required, this is not true when using localhost.
- Once registered, Globus will assign the your application a Client ID (e.g., ebfake35-314f-4f51-918f-12example87).
- You can then generate a Client Secret (e.g., r245yE6nmL_something_like_this_IRmIF=) to be used when making authorization requests.
- When you create an endpoint with Globus, it will be assigned a unique Endpoint ID, which is used in transfer requests.
- Retain these three values so they can be used in configuring the FileTransfer module within LabKey:
- Client ID
- Client Secret
- Endpoint ID
Set Up LabKey Server
- Ensure that the File Transfer module is deployed on your server. If you are unsure, ask your server administrator.
- In some folder, enable the module FileTransfer.
- Go to (Admin) > Site > Admin Console.
- Under Premium Features, click File Transfer.
- Enter the Client Id and Client Secret captured above.
- Specify the various Service URLs for the Globus API. The help text that appears when you hover over the question marks at the end of the field labels provide the URLs that can be used.
- Specify the Endpoint Id for the transfer source and Endpoint Name (the display name) for this endpoint.
- Specify the File Transfer Root Directory where this endpoint is mounted on the file system. Directories used by the individual web parts will be specified relative to this directory.
Create the Metadata List
- Create the metadata list to be used as the user interface for the File Transfer web part. This list should contain a 'file name' field to hold the name of the file that is being advertised as available. Add any other fields that you want to describe these available files. Note that all of the data in this List must be maintained manually, except for the Available field, which is added and updated automatically by the File Transfer module, depending on the metadata it pulls from the mounted directory. If a file is present in the configured Endpoint directory, the Available field will show "Yes", otherwise it will show "No".
Set Up LabKey Server User Interface
This step configures LabKey Server to capture the metadata received from the Globus configuration.
- On the File Transfer: Customize page, enter the following fields:
- Web Part Title: The display title for the web part.
- Local Directory: The path relative to the File Transfer Root Directory specified in the configuration step above. That root directory is where the Globus Endpoint files are mounted for this project. This relative subdirectory will be used to determine the value for the "Available" column in the List you just created.
- Reference List: This points to the List, and it's 'file name' field, that you just created.
- Endpoint Directory: The directory on the Globus Endpoint containing the files.
- Once all of the above parts are configured, the Transfer link will appear on the File Transfer menu bar. Once you select at least one file, the link will be enabled.
Set Up for Testing
When testing the file transfer module on a development server, you may need to make the following configuration changes:
- Configure Tomcat on your development server to accept https connections.
- Configure the base URL in LabKey site settings to start with "https://". The base URL is used to generate absolute URLs, such as the redirect URL passed to Globus.
- Make the development server accessible to the Internet, so Globus can validate the URL.