Picture of Sandra Neubauer
Linking to assets and asset filenames
by Sandra Neubauer - Wednesday, 17 February 2016, 5:33 PM
 

I uploaded a pdf file as an asset.

I want to link to it from a text component. How do I do that?

When I open the asset through the resources drawer the pdf has a very long number/letter name. Is this just in the preview?

Thank you!

Sandra

Picture of Paul Steven
Re: Linking to assets and asset filenames
by Paul Steven - Thursday, 18 February 2016, 10:12 AM
 

Yes the file is renamed when you upload it so you will need to use this renamed filename

Here is how I would create a hyperlink to such a document:

You can get the link to your pdf by adding it to the resources and then it gives you a link something along the lines of 

course/assets/90bd6c356cb0fa3f3b217c97b542ec09e58a6594.pdf

You can then create a hyperlink to it by entering something like the following via the WYSIWYG and selecting "Source" mode 

<p><a href="./course/en/assets/90bd6c356cb0fa3f3b217c97b542ec09e58a6594.pdf" target="_blank">Link</a></p>

Note I had added ./ in front of the link

Note also I have added target="_blank" to ensure it opens in a new tab/window

The word "Link" is my hyperlink - you can change this to anything you wish

I just wrote a separate post about hyperlinks that may be helpful too.

Picture of Sandra Neubauer
Re: Linking to assets and asset filenames
by Sandra Neubauer - Thursday, 18 February 2016, 11:51 AM
 

Thanks Paul, I'll try that!

It's just a bit inconvenient that people can't download the file with the proper name.

Picture of Paul Steven
Re: Linking to assets and asset filenames
by Paul Steven - Thursday, 18 February 2016, 11:53 AM
 

I think it would probably be possible to manually put the pdf files in a folder within the course and link them with your proper file names but tI  haven't tested this theory.

Picture of Matt Leathes
Re: Linking to assets and asset filenames
by Matt Leathes - Thursday, 18 February 2016, 1:23 PM
 

Yes, you could absolutely do this - would need to be done each time you publish of course.

Sandra I think your point is very valid, I can easily foresee a situation where you would want the learner to be able to download a file with a specific filename and the AT should not get in the way of you being able to do that.

Picture of Jason Wilson
Re: Linking to assets and asset filenames
by Jason Wilson - Thursday, 1 April 2021, 2:09 AM
 

Hi guys, just wondering if there was any fix to this?

I see when you add an asset to the "Resources" section, you can specify a name for the file when downloaded, which is great, but there appears to be no way to do this if you are using a text link within a text block.

There really should be an option to keep the correct naming of uploaded files - we require original file names and this just seems like an obvious thing.

I tried manually uploading a file to the "assets" folder and then linking to it, but it just came up as a dead link - where exactly should we be manually placing a file so we can download with the correct file name?

Thanks for any help on this.

Picture of Matt Leathes
Re: Linking to assets and asset filenames
by Matt Leathes - Thursday, 1 April 2021, 9:26 AM
 
but there appears to be no way to do this if you are using a text link within a text block

Add a download attribute to the link. That's how the resources plugin does it.

Picture of Jason Wilson
Re: Linking to assets and asset filenames
by Jason Wilson - Tuesday, 6 April 2021, 10:46 PM
 

Hi Matt, how exactly do I do this? Any time I try to add code manually in the text editor (using the "Source" button), the code gets removed when I hit "Save".

Also, how does this fix the issue of incorrect file names?

Thanks for your help on this.

Picture of Matt Leathes
Re: Linking to assets and asset filenames
by Matt Leathes - Thursday, 8 April 2021, 10:17 AM
 

https://github.com/adaptlearning/adapt_authoring/wiki/Configuring-the-Authoring-Tool#ckeditor-options

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes