The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
I'm having an issue with the file preview feature of Canvas not showing the correct contents of text files.
Here's an example:
On a Canvas Page, I have linked several text files (which I have uploaded to the Canvas Files area):
If I now click on the file preview for world2.txt, I see:
Similarly, if I click on the world2.txt link, I see:
However, when I download the file and open it up, I get:
The downloaded version is correct (compared to what I uploaded to Canvas Files).
There are two issues with the preview versions:
1) The preview is adding a period (.) after some of the numbers which are not present in the existing text file. This is annoying, but the purposes of what I am doing in my course, ok (since 4 and 4. represent the same number in the program my students are using)
2) The preview versions are missing some lines and show a line that is not in the file!!! Specifically, the preview has
4. 4
5. 6 <--- line not in the actual file!
6. 4
while the actual file contains
4 4
4 5 <--- missing from preview!
5 6 <--- missing from preview!
6 4
This is a much more serious problem. What's going on? How can I make Canvas' preview show the actual contents of my text files?
Solved! Go to Solution.
This is a bug in Canvas. I have reported it to the extent that my institution allows me to.
@hasti , I haven’t seen anything like this before, but it’s definitely troubling. My recommendation is to submit this information to Canvas Support to see if they can help. You can do this by going into Canvas, clicking on Help, then click on Report a Problem.
Thanks, @kona . I'd love to report this problem, but it appears that that is not an option I am given at my institution:
Is there somewhere within the Canvas Guides that I can access a "Report a Problem" feature?
Hi @hasti ...
It looks like your school has done some custom work within the "Help" menu and is directing you to either the "Chat with DoIT Help Desk" or "DoIT Help Desk Support Hotline" options instead of the "Report a Problem" link. Posting this issue to the bottom of a Canvas Guide isn't the same as reporting it as an issue via "Report a Problem" because tickets are not created when posting questions/comments to Guides (even though the Docs Team may reach out to you for assistance). Have you tried either of the top two options that you have available?
I second what Chris said, it looks like your school has its own system for Canvas Support and I’d try one of the top two options and see if they can help. Please let us know what you find out.
Yeah, I'm quite familiar with DoIT's "help" desk having spent literally decades trying to get "help" from them (often I have had to start by convincing them that I have actually used the LMS before and in the past has quickly revealed that I know more about Canvas than they do). Hopefully, since they have taken away my ability to report a problem, they will take more responsibility for listening to and responding to Canvas help requests.
This is a bug in Canvas. I have reported it to the extent that my institution allows me to.
Thanks for updating us on this! Hopefully it will get fixed soon!
Not holding my breath. But it would be nice if someone could at least offer a workaround.
I’m not sure what you subject you teach to know what workaround might be appropriate, but two things I was thinking of were: (1) putting the file content on a page - so the text of the file would be on a page in Canvas. Then tell students to copy and paste the content to their document. (2) Google Doc or Collaboration with the text.
I teach computer science to university students. Asking students to copy-paste a gigantic data file from a page I have to create in Canvas is unreasonable. These are data files they are feeding into their programs, so they need to be able to be downloaded. (And, as a computer scientist, I find it incredible that Canvas' file preview cannot preview a simple plain-text file ending in a .txt extension correctly. Seriously?!? Just display the exact characters as they are in the file. It's PLAIN-TEXT.)
I thought the point of having an LMS is that there would be ONE place I could send my students to for info related to the course. The more I deal with Canvas, the more it seems there are significant problems with it that Canvas has no interest/ability to fix so that there is this increasing difficult-to-find knowledge base of hacks to Canvas that pull in aspects of Google Docs and other reasonable management systems that require esoteric skills (and the time to learn them).
I'd much rather have a File Preview that worked correctly than be able to change the colors on my Dashboard, but apparently Canvas thinks that's a much more critical thing to address than an actual bug in their code.
Hi, @hasti .
As best as I can tell, the Canvas document viewer is "trying" to be helpful and failing miserably. It looks like it's assuming that you are doing some sort of sequential line numbering and "fixing" your sequence for you. Definitely a bug.
If the help desk is unable to assist, request that they escalate the case to Instructure Canvas Support. If necessary, request to speak with whoever manages the help desk, their boss, or the CIO (Office of the CIO - UW-Madison Information Technology) as a last resort.
Best,
Nelson
The help desk was able to replicate this and escalated it to Canvas. The Canvas engineers acknowledge it's a bug. I have been given no info about any time frame for fixing this or for any workarounds in the meantime (such as disabling file preview ability for data files I want my students to download and use in their programs so they do not have access to the Canvas-corrupted file display).
Hi Beck--
I don't know if you mentioned disabling inline file previews because you already found it on your own, or because you were throwing it out there as a possible workaround that should be available. If it's the latter, this may help: here's how you disable inline file previews.
For kicks, I tried recreating the file example, above, and encoding the file in a number of different plain text formats. I got the same result you did for all of them.
The issue with this rendering in SpeedGrader is good to know, and I probably wouldn't have thought of it, but it's consistent, since it's the same document previewer in all locations in Canvas--it's only that markup tools are available in some places, but not in others. .
Thanks for the link, @tom_gibbons . Only one small problem - the student can still click on the link and it opens up in a separate page (within Canvas) and shows the corrupted File Preview ![]()
Ach. Yes. It used to behave differently and send students to a direct download of the file. Possibly prior to the DocViewer implementation.
The only viable workaround would be to tell them to download it in the instructions. OR link to a shared Google Drive file upload, which doesn't result in the same problem. It creates the additional problem of needing to manage course content in multiple locations, though, which may or may not be a drag, depending on how you like to manage things.
Heads up - this bug is also present in the Speedgrader. So that means if you (or your TAs) ever graded text files turned in by students by looking at them in the Speedgrader, you should know that you may not have been viewing the actual contents of the files turned in by the students.
(Non)Update: This bug is still in there (and has caused problems in the completely on-line Canvas class I am teaching this summer). It affects the file preview of text files ANYWHERE they show up, including on content pages (which is where I am having the main issue this summer - the students literally can't see the correct output text file their code should produce).
I am seeing this exact same behavior. This really needs to be fixed, as it is showing students completely incorrect file contents! I am shocked this was reported above almost a year ago and this hasn't been addressed.
I completely agree -- my students are asking me about what they are seeing in Canvas (because it's not the contents of the file I did upload to Canvas). The fact that Canvas can't (or won't) even get the preview of a simple PLAIN TEXT FILE correct AND won't make any attempt to fix it over the course of nearly a year shows just how much they actually care about customer feedback about BUGS in their product, IMO.
Come on Canvas! This is still a problem. Actually, now it seems to be even worse. I used to tell my students they had to download the file as opposed to previewing it in Canvas. Now, though, that doesn't seem to work either, since it tries to download an HTML file instead of the txt file.
This is so very frustrating. This has been a known issue for almost two years. The only remotely-reasonable workaround I can think of is to put the txt files in the "Files" area instead of attaching them to the assignment. Then I have to make the students read the assignment on the assignments page, then go over the files section, and individually download each txt file associated with the assignment.
This is crazy - its JUST a text file. Canvas: this needs to be fixed.
Hi Beck, FYI, I reported this a couple of months before you regarding PowerPoint files. With PPT files the results are even stranger with font sizes changing, images that had been deleted in the file showing up, etc. I suspect it is not just a Canvas issue, but also something related to Microsoft.
Good luck!
https://community.canvaslms.com/thread/20687-powerpoint-preview-error-in-canvas
I gave an online exam and provided students with a text file where they could type their answers. If the fourth question had 3 parts, then it looked like
4.
4.1)
4.2)
4.3)
In previewing the student submissions, I found all that numbering had been modified!
I couldn't imagine Canvas would change my file, so I figured I must have published a defective file.
Finally I realized it was just the preview that was messed up. Preview of a TEXT file. Incredible.
2 years after this problem was first noted here. Still not fixed.
I received a notice from Canvas Support on 9/3/21 that a fix for this issue is in QA and is expected to be released soon. I don't have any more details, but there appears to be a solution on its way soon 🤞.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.