How to make a link to an uploaded file.

One in a series of Guidance Notes: Uploads and Linking

I made this first link by

  1. selecting the text I wanted to use as the link (i.e. the words 'a file'),
  2. clicking the link to content buttton in the edit bar,
  3. typing a word in to the Search for content autocomplete box (which then shows both the real filename, and what were have been calling the 'Drupal name' (i.e. title), and
  4. selecting the relevant file.

(One does need to have some idea of what will appear in the title [or filename?] for this approach to work.)

  • This is a link to a file that was already in the Library.

This next example illustrates Catherine's point. I attempted to make the link by

  1. selecting the same words (i.e. 'a file') then
  2. adding the link by clicking the Add media button on the edit bar, and
  3. choosing from the Library

Note that the insertion process has substituted the 'Drupal name' for my selected text (and will presumably rename the link if that file title is changed).

  • This is a link to [[{"fid":"18","view_mode":"default","fields":{"format":"default","field_media_description[und][0][value]":"","field_media_author[und][0][value]":"","field_media_author[und][0][_weight]":"0","field_media_copyright_owner[und][0][value]":"","field_media_date_published[und][0][value][date]":""},"type":"media","link_text":"BCL","attributes":{"class":"file media-element file-default"}}]] that was already in the Library, but made a different way.

And finally, here is a link to a file I made as I wrote, by

  1. selecting the same words (i.e. 'a file') then
  2. clicking the Add media button and
  3. and uploading it.

Not entirely surprisingly, the behaviour is the same as in the previous case, and my selection (the words 'a file') have been replaced by the file's display name.

  • This is a link to [[{"fid":"32","view_mode":"default","fields":{"format":"default","field_media_description[und][0][value]":"","field_media_author[und][0][value]":"","field_media_author[und][0][_weight]":"0","field_media_copyright_owner[und][0][value]":"","field_media_date_published[und][0][value][date]":""},"type":"media","link_text":"Planning for Learning - a pdf file","attributes":{"class":"file media-element file-default"}}]] that I uploaded as I wrote.

In short, to hang a file link on to the text of your choice, the file must already be in the Add media | Library (or the subset that is 'My Files') and the link made from the Link to Content button.

On this page