Found this content helpful? Log in or sign up to leave a like!

Using Relative References in HTML src/href

Mr_Wood
Community Member

We have run into an interesting problem where various pieces of HTML are causing issues with their file path references are not changing when the course content is copied to a new course.

It appears that the reference (in this case an audio file) in the new course still refers back to the old course's file. When we put the audio file in, in the background the url is in the form of "https://school.instructure.com/files/2342313/" The files when copied to a new course don't match that number, and we cannot give students permissions to the original course, nor can we go through and change every reference to reference the new courses' files; the only two options we've figured out so far that make the new course work for our users.

Is it possible to create relative links that are referencing the file structure within a course? That way putting all the audio files in a folder named the same makes all the HTML references work correctly.

Running into the issue of not being able to automatically detect what course the files are in to properly create a relative reference that would work for every course; and even inputting the correct course it doesn't appear to accept similar URLs to what is given when you browse to a file within the course directly.

 

Edit: Further information

https://qed08.instructure.com/files/4432626/download  this as a URL works as a source for the audio element. The number after the files is referencing a course specific file, but doesn't automatically update.

According to what I can find on HTML referencing, since the Audio element sits in https://qed08.instructure.com/courses/91877/assignments/95497  then putting in a reference to ../files/folder/Quiz%20Recordings/Lesson%201/Audio.mp3 should direct the audio tag to go back up one level to https://qed08.instructure.com/courses/91877/  then add the remainder of the path to make it into https://qed08.instructure.com/courses/91877/files/folder/Quiz%20Recordings/Lesson%201/Audio.mp3 which is where the file is placed but it doesn't recognise this style of pathing.

Labels (3)