cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cameron_redsell
Community Participant

Making csv files for download for students

Jump to solution

How do I make .csv files available in Canvas so they are able to be downloaded with Safari? I, and my students, seem to get a txt file with "unauthorized" when downloading .csv files with safari. Is there a way I can better make the file available for the students to avoid this?

0 Kudos
1 Solution
cameron_redsell
Community Participant

Small update, looks like there was a Canvas change that caused this behaviour a while ago and I didn't see it. Also includes the same solution
https://community.canvaslms.com/t5/Canvas-Question-Forum/Forcing-download-of-file/m-p/431593

View solution in original post

0 Kudos
5 Replies
Ron_Bowman
Community Champion

@cameron_redsell -

First, I assume there is a specific reason that you and your students are using safari, but it would be interesting to know if you can successfully download the csv file when using a different browser - like chrome.

Second, how are you making the csv file available to the students?  Is it from the files area?  Is it from a link in an assignment or page?

I just tried this in my playground, and as a true student I can download the csv file from a page or from the files area.  I did not try an assignment, but I imagine it would work there as well.  

The best way we could help you would be to know if the download does not work in Safari but it does in chrome, then safari is the problem.  If it is a problem in both browsers, then there may be something strange with the way you made the file available for download

cameron_redsell
Community Participant

I know it's very easy to point at browsers and say they are the problem and you should conform, but I like to support my students where they are (not to mention some accessibility and privacy concerns). But let's just move past that point for now.

 

I have been able to work around the way Canvas is encoding files for downloading by adding "download" to the href request. That does help, but still not perfect. The preview page still opens and that new link fails. I'll keep investigating. 

0 Kudos

@cameron_redsell -

I tried to phrase my question about chrome to avoid what you stated about conforming to a specific browser.  Rather I wanted to know if you had the same issue in Chrome as you do in Safari.  If the problem existed in both, then that would require a different solution vector than if it was in Safari only.

I am still confused as to why you are having an issue.  When I put a link for a file on a page or in an assignment description or in a quiz, I get a download symbol at the left of the name which can be clicked on to download the file - this works for me in Chrome with no issues.  I do not have to do anything special to have that done.  Furthermore, if I click on the file name I go to a page where I have to download the file as the .csv file is not displayable.

download_csv.jpg

If I read between the lines correctly, on Safari when you go to download the file, it ends up as RTF or something like that.  In that case, it is a situation where Canvas is not behaving properly in Safari.  So it is a compatibility issue of how Safari is interpreting what Canvas is sending.

 

0 Kudos

Sorry for being defensive. We just get “you’re using the wrong browser” a lot. I could go into detail why I think that bad, but I apologize for taking it so badly.

as for the csv download. I have found some support pages that suggest Canvas explicitly does not support csv files, so that’s probably related. The issue for me is the student does get a file downloaded, but it only contains the word “unauthorized” so they think they have the wrong link or I’ve uploaded the file wrong. My guess is there’s some processing happening within canvas that Safari is handling more securely and treating it as a tampered file.

I have found with the coding I mentioned I can get the download button to download the correct file, but clicking and previewing the file still has this problem. There’s definitely some sort of bug (really hope this isn’t a desired behaviour). I’m fairly certain with some html coding I can get it to work properly, but this isn’t really something I’d expect faculty to implement themselves.

My proposed solution would be to add some options (like there are for pdf files) that would force a download only link with no preview. I have similar issues with other proprietary file downloads and canvas trying to preview.

cameron_redsell
Community Participant

Small update, looks like there was a Canvas change that caused this behaviour a while ago and I didn't see it. Also includes the same solution
https://community.canvaslms.com/t5/Canvas-Question-Forum/Forcing-download-of-file/m-p/431593

0 Kudos