This topic describes how users can view and share files that have been uploaded to the files repository. Collaborating with a shared file browser makes it easier to ensure the entire team has access to the same information.
Add Files to the Repository
Learn more about creating a file repository and uploading files in this topic:
Using the Files Repository.
Learn about using the data processing pipeline to upload on a schedule, in bulk, or with special processing in this topic:
Data Processing Pipeline. Pipeline tasks can also be run on files already uploaded to the repository as they are imported into the database providing further processing and analysis.
File Preview
If you hover over the icon for some types of files in the
Files web part, a pop-up showing a preview of the contents will be displayed for a few seconds. This is useful for quickly differentiating between files with similar names, such as in this image showing numbered image files.
Select Files
To select a single file, use the checkbox on the left. You can also click the file name to select that file.
Many actions will operate on multiple files. You can check multiple boxes, or multiselect a group of files by selecting the first one, then shift-clicking the name of the last one in the series you want to select.
File Display in Browser
Double-clicking will open some files (i.e. images, text files including some scripts, etc) directly, depending on browser settings. Other files may immediately download.
File Download Link
For flexible sharing of any file you have uploaded to LabKey Server, you can make a download link column visible.
- Navigate to the Files web part showing the file.
- Make the Download Link column visible using the (triangle) menu for any current column, as shown here:
- Right click the link for the file of interest and select Copy link address.
- The URL is now saved to your clipboard and might look something like:
http://localhost:8080/labkey/_webdav/Tutorials/File%20Repository/%40files/LabKeyDemoFiles/Datasets/Demographics.xls?contentDisposition=attachment
- This URL can be shared to provide your users with a link to download the file of interest.
Users will need to have sufficient permissions to see the file. For information on adjusting permissions, please see
Security.
For file types that can be
displayed in the browser, you can edit the download to display the content in the browser by removing this portion of the URL:
?contentDisposition=attachment
For other display options that can be controlled via the URL, see
Controlling File Display via the URL.
Note that this simple method for showing the Download Link column is not permanent. To configure your files web part to always display this column, use the file browser Admin menu, Toolbar and Grid Settings tab instead.
An alternative way to get the download link for a single file:
- Click the title of the Files web part to open the manage page.
- On the Manage Files page, place a checkmark next to the target file.
- At the bottom of the page, copy the WebDav URL.
Get the Base URL
To get the base URL for the File Repository, you can select the
fileset item on the Manage Files page, or from anywhere in the folder, go to
(Admin) > Go To Module > FileContent. The base URL is displayed at the bottom of the File Repository window, as shown below:
Link to a Specific Directory in the File Repository
To get the link for a specific directory in the repository, navigate to that directory and copy the value from the WebDAV URL field. You'll notice the subdirectories are appended to the base folder URL. For example, the following URL points to the directory "LabKeyDemoFiles/Assays/Generic" in the repository.
Use 'wget' to Transfer Files from the Command Line
You can use command line methods such as 'wget' to access file system files, given the path location. For example, if there is a file in your File Share browser called "dataset.xls", you (as an authorized user) could
download that file via the wget command like this, substituting the path to your @files folder:
wget --user=[LABKEY_USER_ACCOUNT_NAME] --ask-password https://www.labkey.org/_webdav/ClientProject/File%20Share/%40files/dataset.xls
This would prompt you to provide your password for labkey.org and the file called dataset.xls will download to your computer in whatever folder you are are in at the time you ran the command.
If you have a file to
upload to your file browser, you can also use wget to simplify this process. In this example, user "John Smith" wants to deliver a file named "dataset.xls" to his "ClientProject" support portal. He could run the following command, remembering to
correct the path name for his own client portal name and name of his file share folder:
wget --method=PUT --body-file=/Users/johnsmith/dataset.xls --user=[johnsmith's email address] --ask-password https://www.labkey.org/_webdav/ClientProject/File%20Share/%40files/dataset.xls -O - -nv
He would be prompted for his password for labkey.org, and then the file would go from the location he designated straight to the file repository on labkey.org. Remember that users must already be authorized to add files to the repository (i.e. added as users of the support portal in this example) for this command to work.
Related Topics