Skip to main content Skip to secondary navigation

Add and use files in the Media Library

Main content start

You can add txt, rtf, doc, docx, ppt, pptx, xls, xlsx, and pdf files under 5 Mb to your media library on Stanford Sites. All other files shared from your website should be hosted on a Google Shared Drive or other document management system.

Add a file to your media library

  1. After selecting File, you will be redirected to the Add File page:
Screenshot illustrating Adding a File
  1. Enter the name of your file in the corresponding text field.
  2. Select Choose File under the Image title. A popup will appear and you can select the file you would like to upload.
  3. Click Save.

Best practices

  • You should include the file extension (.doc, .pdf) in your filename
  • You should not have spaces in your file name
  • Files should all have unique names, even if the file type is different

Use your file in your content

Once your file is in your media library, you can

  1. Embed it as you would an image or other media 
  2. Link to it as you would link another page on your site. 

When embedding a PDF, you'll want to use a text area, either in a Text Area Paragraph or Card Paragraph to provide a link to your file. The link tool will display content pages first and the any files that match your search terms, making it very easy to link to a PDF or other document.

The link fields provided by Cards Paragraphs, Banner Paragraphs and other paragraph types do not support this functionality. To link directly to a document using one of those fields, you would need to go to the Media Library and edit the media item to obtain the direct link, and then paste that into the field. 

Embed documents (files) from the Media Library

When you upload a document to your site, you can add a simple link to it in the text editor. Using this approach will display the filename and size of the document, and will appear as:

samplepdf.pdf (28.37 KB)

  1. Place your cursor where you'd like the link to appear
  2. Click on the Media Library button
  3. Select media type File
  4. Either upload a new file or select an existing file. 
  5. Save and insert the file.

Link to files in the Media Library

  1. Highlight the text area you would like included in the link.
  2. Click on the Link button in the Text Area toolbar to open the Add Link modal.

  3. In the URL field, start typing the Media Name for the document you are trying to link to. Suggestions of documents will appear as you continue to type.
  4. Once your desired document appears, select it.
  5. Click Save, and your link should appear as follows:

Sample (PDF, 30KB) 

Name your file link

Clicking on a link to a document, such as a PDF or Word document, is different from clicking on a link to another page on a site. When you click on the document link, it can open or download the document. If you're not expecting it, the appearance of the document can be surprising or inconvenient. If you have limited bandwidth or space on your device, a downloaded document can be troublesome. 

When creating a link, the text should identify the purpose of the link and allow users to decide if they want to follow the link. The text for a link to a document should convey the titledocument type, and size; using these in the link text makes it possible to meet WCAG 2.0 2.4.4.

We suggest providing the file name, type, and size as follows:

[name] ([file type], [size])

For example: Sample document (PDF, 1MB)

Check file permissions

Your site files are public. If your document is sensitive and restricted to Stanford or specific viewers, you must store the document on Google Drive or another secure location, not on your site. It is your responsibility to ensure that file permissions are correctly managed. 

How to manage permissions on Google Drive.

Ensure all files are accessible

All content on your site must be accessible to assistive technology such as screen readers. This includes PDF, Word, and PowerPoint files. See more information about how to make files accessible to everyone.

Related Topics