Is there any way to get a permalink to a file in the Files section in a Course? If there is, I can't find it. When any file is updated, it gets a new reference URL which destroys the ability to link to the file and update it in the future without going back are resetting all the links you've made to the file. In other words, if I upload a .zip file to Files, a link to it looks something like this: https://dvc.instructure.com/courses/21963/files/folder/media?preview=804345 , but if a overwrite the file with a newer version, the preview=804245 part of the link is now preview=804346 or some other number.
This flies in the face of good database-driven CMS/LMS design. Anything stored in the database should have a way of getting a permanent link so the updating links issue doesn't present itself. Also, there's an actual Paradox in this non-permalink issue. I have html pages in my files that should cross-link each other, but if I update one page with the link to the other page, then that page has a new preview number, so the second page linked back to the first fails to link to it. And if I update that page with the correct link to the first one, the first one now has a bad link to the second. That's why you don't design a system that doesn't have permalinks.
permalink , permalinks
EEGAD: I did not know about this. Thank you so much for pointing that out! OUCH.
That is seriously terrible, and I agree with you that it flies in the face of good design practice.
It's very frustrating to me that the Files section doesn't work like real webspace in your own directly (so that you can directly link to things via a simple URL, instead of the https://___/courses/___/files/___/download ), but I had no idea that when you overwrote a file with a new version that the file number actually changed.
That is what I think you are saying here, and I am going to go test that for myself to make sure I understand.
Pinging @James ... although I know he is on the road (with CanvasKids!) so he probably won't see this right away.
Whoa whoa whoa whoa: you are right, @jkhazar253 , and I agree that this is a HUGE problem. It also flies in the face of what Canvas is telling users, so I never even suspected that something this wrong was happening.
The prompt tells me that I am REPLACING the File, and I say yes, please, replace the file:
But it is not replacing the file, just as you have pointed out.
The first file got this number:
update: that link is now broken as a result of my having "replaced" the file with a new version
But then the file with the same name, the file that I (supposedly) replaced with a new file is actually a new file with a new number:
Words fail me for how terrible this is. Now I feel like I should not encourage people to use Files in this way because they cannot update the content safely. I really thought using Files this way to help people use dynamic scripts was a really good solution. But now I realize it is not a solution at all. If you want to work with content in this way (calling the contents of a file to run as a script in an iframe, for example), you really need your own webspace.
So... thank you so much for pointing this out! I (wrongly) assumed that when Canvas told me I was replacing the existing file that I was doing exactly that: replacing the file. I had no idea that Canvas was creating a new file with a new number. And now I have to figure out what to do. I feel terrible now for advocating to people that they use the Files space. It looks like anyone who is serious about content and asset management has got to use their own webspace instead. Otherwise, Canvas is basically telling you that you can never change your content; you are stuck with the old version OR you are going to break your own calls to the FIle.
Well, I always use my own webspace anyway... so I will just say once again, THREE CHEERS for the great guys at Reclaim Hosting and their incredibly easy HTTPS option:
Can anybody from Canvas throw some light on this problem...?
The method you're using to load the content within an iframe isn't officially supported -- at least I don't remember seeing it. I think I just came up with it by looking at the URL when I was previewing a file and it worked. Like many other things that aren't officially supported or documented, we're finding that they're coming back to bite us. The best solution is to manually update
If you had a link to the file using what Canvas put in, then what Canvas does is change all of your links to refer to the new file when you replace an existing one. The preview=5781661 is a query parameter and not part of the pathname. Canvas hasn't been taught to look for file IDs as part of that as that's not how it generates the links.
As for good database design that was mentioned in the original message, what Canvas often does is keep all of the content but mark it as deleted or some other flag when it's no longer in use. Unfortunately, that's not what is happening right now.
What I am experiencing through the API has changed from what I believe I explained to people in the past, so you may want to file a support ticket and see if this is really what is supposed to be happening.
When I search for my old file using the API
I get the new object
Notice the created_at, updated_at, and modified_at dates are all for the new object, not for the old one. That means that we can't tell when the original file was put out there, just when the replacement came into existence -- and that is the part that is different, although perhaps undocumented. I found the place where I explained the dates and the current behavior does NOT match what was happening on May 5, 2017: https://community.canvaslms.com/message/69238-re-publication-date
That is really helpful, @James , and thanks as always for the information!
As @jkhazar253 originally said, though, it is not good design, at least not for the user. Canvas is not replacing the file as the pop-up states explicitly; Canvas is deleting the old file and uploading a new file. If they are able to update all their links internally, well and good, but users who think they are replacing a file will find the hard way (broken links) that they did not replace a file. They deleted an old file and uploaded a new one, with a new file ID number.
It's bad enough having to iframe your own content in a Page, but this crosses the line with me. I cannot recommend that someone use that hack to get dynamic content into Pages. It was nice to be able to tell people it was possible, but if all it does is put people into an unsustainable trap, I cannot recommend it now that I understand this prevents people from ever updating the content.
I'm very disappointed about this. VERY disappointed. Other frustrations I've had with Canvas have been purely my own personal preferences not being satisfied (and hey, that's okay; I am a marginal, eccentric user), but this is far worse. Now I've got discussion posts everywhere here at the Community and blog posts in my own space where I have made this very bad recommendation to people. It's going to take forever to go back to all those posts and warn people that if they use this workaround they either cannot ever upload a new version of the file ever OR they have to manually keep track of where they link to the file so they can manually redo the link. What a mess.
So, again I have to say THANK YOU to @jkhazar253 for finding this out and documenting the problem here. I never would have suspected that replace is NOT replace. So, better late than never. I feel terrible for having given bad advice to people all these months, but at least I will not give bad advice like that in the future.
I'm pinging ishar-uw also since she is the one who first explained this hack to me, just in case she also was not aware that it is not a sustainable hack after all. Argh................
As for using an outside web server, that's a problem because I don't want students to have to log in twice, and I especially don't want to deal with the copyright fair use issues and intellectual property issues that might arise if I host my own pages and make them available to the public.
copyright custom css #workarounds
That's a case where the content is dynamic, being generated on the fly from Inoreader; works perfectly with Redirect Tool.
Aha, @jkhazar253 , I just saw this comment before posting my own. I rely on public domain content in my classes, so I am totally cool with having all the content be open.
About iframes, yes, I find it completely annoying that I have to do that. I've made it work, more or less, but it's not my favorite. You can see the results I've managed to get here in this open Canvas space:
Anyway, I share your frustration; if I were actually having to rely on Canvas to deliver content to my students, I don't know what I would do. There's really no way I could make it work... so, thank goodness for the public domain content and the open web. That's been my focus ever since I started developing online materials a gazillion years ago (I've been teaching online since 2002). Long live the public domain!