U of I Box, Direct links, embedded images, and anonymous file sharing
How to create direct links to Box files for embedded images or anonymous file sharing.
By default, Box "shared links" show up within the Box framework and include data about the file's creator. If you want to use Box to store images or files that you'll embed in web pages, or if you want to send a file to someone anonymously, you'll want to use a "direct link" instead of a "shared link."
How to tell what kind of Box link you have:
If the Box URL begins with...
- https://uofi.box.com/s/ : you have a shared link which will include the Box framework.
(This is not the link type you want if you want to embed something in a website, and/or if you want the most accessible experience.)
- https://uofi.box.com/shared/static/ : you have a direct link which will let you embed the file in a web page or share anonymously.
(This is the link type you want if you want to embed something in a website, and/or if you want the most accessible experience.)
- https://uofi.box.com/v/ : you have an alias. Look at the sharing settings on the file in order to determine which link type that alias refers to.
How to create a direct link:
In order to create a direct link, first you'll need to create a shared link, and then you'll need to modify its settings.
Step 1: Creating the shared link
If you're starting from the Box web interface, when you select the item you want to share, a Share button will show up in the selection bar.
1.1. Click the Share button to open the Share 'Your file' interface.
1.2. Under the Share Link headline, turn on the "Shared Link is created" toggle.
1.3. Click the blue Link Settings item above the Copy and Mail icons.
Step 2: Creating the direct link
The Link Settings window allows you several control options for how you share a link. In this particular case, we want the last two items in the window:
2.1. Under Allow Download, check the box beside "Allow users with the shared link to download the item."
2.2. Under Direct Link, a text box will contain the direct download link starting with https://uofi.box.com/shared/static/. Click the Copy button to copy this direct URL.
2.3. Make sure to click Save so that the newly created direct link is stored.
Step 3: Using the direct link
If you want to embed an image that's stored in Box in a website, you'd use this direct link (/shared/static/) instead of the shared link (/s/). The link syntax would look something like "<img src="https/uofi.box.com/shared/static/(your file's hash code here)">".
If you want to share a file anonymously with others, such as for anonymous peer review, you'd send the direct link to your collaborators.
If you want to make sure you have the right version of the link, open a new anonymous browser tab or a different browser window where you're not logged in to Box. Paste the URL.
If you see just the image or get a file download prompt, you have a direct link.
If you see the Box interface including dates and names, you have a shared link.
If you get an error message in the anonymous window, double-check that the Shared Link toggle is on, that the Link Settings' Allow Download box is checked, and that the Direct Link link is saved.