In Sitecore, images and media files are stored in the Media Library. Before using an image on a page or in a component, it needs to be uploaded to the Media Library first.
You can upload images in different parts of Sitecore, depending on where you're working:
- Uploading a document file (Content or Experience Editor)
- Attaching a document from within a Component in the Content Editor
- Upload batch files
Once a document file is uploaded into the Media Library, you can modify the file properties and perform other useful functions.
- Changing document file properties (file name, teasers)
- Over-writing a document file
- Deleting document files
Uploading a Document File (Content or Experience Editor)
- Content Editor: Click the Media Library tab at the bottom-left.
The Media Library window opens.
- Experience Editor, right-click on the Sitecore Platform icon
at the top left corner of the screen to open in a new browser tab so you still have access to the Experience Editor to get back to. Select the Media Library
icon. The Media Library window opens.
- Navigate to the folder or sub-folder you want to store the document(s) in.
- Select the Upload files (advanced) button.
- From the Batch Upload dialog box:
- Select the Choose File button.
- Browse and select the document(s) on your computer.
- Ensure your documents are named concisely and accurately.
- You can upload more than one document at a time.
- Check the appropriate boxes:
- Make uploaded media items versionable - Provides the ability to save versions of your images.
- Overwrite existing media items - This option allows you to upload a file with the same name as an existing file in the Media Library to replace the old file. If you don't select this option, a duplicate file will be created instead of replacing the original.
- Unpack ZIP archives - Select this option to upload and extract a Zip archive to the Media Library.In the .zip file, you can include subfolders with files. The folder structure is re-created in the Media Library after the files are extracted.
- Upload as files - This option to store the file in the file system rather than in the database. Keep this option unchecked.
- Select the Upload button.
-
Select the Save Changes
icon located at the top left of the screen.
- Select the Edit
icon to display drop down options and select
Check In.
- Publish the Media Library file for the change to take affect.
Attaching a document from within a Component in the Content Editor
From the Content Editor, you can upload documents from within the component content areas. Sometimes it will be directly from the Data links area or you could also upload from within the Rich Text Editor. From either, select the Insert Sitecore Link. The Media Library window will open.
- Select the MEDIA ITEMS tab.
- IMPORTANT: Navigate to the folder you would like to upload the document to and select it before moving to the next step.
- After selecting the folder, click the Upload button (lower left).
- Click Choose File, and select the file from your computer.
- Click the blue Upload button.
- Click Lock and Edit if prompted. Update the title or add keywords as needed.
- Click Save/Close.
- Finally, click Insert. Finish editing the component.
- Select the Save Changes
icon located at the top left of the screen.
- Select the Edit
icon to display drop down options and select
Check In.
- Publish the Component.
Uploading Batch Files
- Navigate to the folder or sub-folder you want the files(s) stored in.
- Select the Upload files (advanced) button.
- Browse your computer and select the ZIP file that contains the files and folders you wish to upload.
- Select the Unpack ZIP archives - Select this option to upload and extract a Zip archive to the Media Library. In the .zip file, you can include subfolders with files. The folder structure is re-created in the Media Library after the files are extracted.
- This upload may take some time depending upon the file size.
- Once successfully uploaded, the folders and files will display in the content area.
- Select the Save Changes
icon located at the top left of the screen.
- Select the Edit
icon to display drop down options and select
Check In.
- Publish the Media Library file for the change to take affect.
Viewing or copying the document file URL from the website
When you hyperlink to a document file, the URL does not show as the final URL, but something like this - "https://portal.ct.gov/sitecore-center/-/media/sde/21st_cclc/cohortix.pdf". You can get the final URL from a document file two ways:
- Locate the link of the document file on the website page.
- If the page is not published, then view the page in Preview mode.
- Right-click on the document file name.
- Select the Copy Link Address option from the dropdown.
- Paste the copied Link Address onto your designated area to view the URL.
-
The final URL will look something like this example - http://portal.ct.gov/-/media/Training/Documents/Document_File.pdf
-