Solved! Go to Solution.
if I understand, you basically want to access the files inside a Canvas course, using CSS, and move them externally. Files in Canvas are not linked to a course, they have their own unique identifier. Why? For instance, a teacher might have an exam stored in files that they don't want accessible until a certain time. If you could just go into the Files externally, anyone in the world could pull that exam out- even if they weren't enrolled in the class or a member of Canvas.
Here's an example of what I mean:
This is the files section of a random sandbox course. If I mouse over the "007.png" file, the second picture shows the link.
Notice there is NO attachment to course... and there's no "007.png" either. There's no .png at all, in fact, which means your idea to pull PNG files out with CSS is impossible.
if I understand, you basically want to access the files inside a Canvas course, using CSS, and move them externally. Files in Canvas are not linked to a course, they have their own unique identifier. Why? For instance, a teacher might have an exam stored in files that they don't want accessible until a certain time. If you could just go into the Files externally, anyone in the world could pull that exam out- even if they weren't enrolled in the class or a member of Canvas.
Here's an example of what I mean:
This is the files section of a random sandbox course. If I mouse over the "007.png" file, the second picture shows the link.
Notice there is NO attachment to course... and there's no "007.png" either. There's no .png at all, in fact, which means your idea to pull PNG files out with CSS is impossible.
I know this is an older question, but wanted to add a bit of intel here.
The answer is yes, if you have (or can get) the Canvas courseID for each course that the CSS is referencing.
Files held in each Canvas course can be referenced from the course's folder structure with the path
file_contents/course%20files/
However, this is the relative path assuming you are starting within the course folder. The full path from the root would be
/courses/123456789/file_contents/course%20files/
Where "123456789" is the current course's courseID. This can be useful when you're working in HTML mode within a Canvas Page, for example:
<img src="/courses/123456789/file_contents/course%20files/images/walrus.jpg" alt="The Walrus and the Carpenter, from Alice Through the Looking-Glass" />
AFAIK there is no way to dynamically get the current courseID with just CSS. You'd have to load the courseID into your CSS dynamically, which is totally possible with Javascript, but that's another topic!