I’m not able to export user list as excel file and it’s showing un-understandable characters

I’m not able to export user list as excel file and it’s showing un-understandable characters

by Mohamed Aljefri -
Number of replies: 7

Hello,

 I’m not able to export user list as excel file and it’s showing un-understandable characters  attached snapshot.

 un-understandable characters


But when I clone the environment to deferent test server (Shared Server) it work good and able to export as csv & excel normally.

Is there php or permission required for that. Please I need your help please.

 

Thanks

Mohamed Aljefri


Average of ratings: -
In reply to Mohamed Aljefri

Re: I’m not able to export user list as excel file and it’s showing un-understandable characters

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Those non-understandable characters look like the raw contents of an Excel file. If you saved it from you browser as a .xlsx file you should be able to open it.

Moodle sends an HTTP header – Content-Disposition: attachment; filename="Users.xlsx" – which the browser should understand to mean "Download this file instead of showing it".

Which version of Moodle is this? Is it the same version on the test server? What version of what browser are you using? Does the same problem happen if you use a different browser (e.g. Firefox)?

Average of ratings: Useful (2)
In reply to Leon Stringer

Re: I’m not able to export user list as excel file and it’s showing un-understandable characters

by Mohamed Aljefri -
Thanks leon for your reply.

I'm using moodle version 3.9.1 and I try from different browser (Firefox, Chrome) and different machine it's same.
I think it's not from moodle or browser. Because i just copy to another host shared server i owned and it's download normally.
the server what I'm using it's new dedicated server and I install all PHP extension required
I feel there is some permission needed for popup or allowing download file. as you say it's open in the browser not downloaded. if i chose HTML table is showing data perfect.


Thanks.
In reply to Mohamed Aljefri

Re: I’m not able to export user list as excel file and it’s showing un-understandable characters

by Mohamed Aljefri -
In reply to Mohamed Aljefri

Re: I’m not able to export user list as excel file and it’s showing un-understandable characters

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

If I understand that post the problem was with the theme (Aardvark).

What theme does your site use? Is it the same on both sites? If the theme is not Boost, try switching to this and see if the problem still happens.

In reply to Leon Stringer

Re: I’m not able to export user list as excel file and it’s showing un-understandable characters

by Mohamed Aljefri -


I'm using Eguru them and I changed to Boot and Classic and I Clear them caches and still the same issue 😫

but the strange thing. Exporting grades to excel is working fine. 😲

In reply to Mohamed Aljefri

Re: I’m not able to export user list as excel file and it’s showing un-understandable characters

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Interesting, Mohammed. I tried from my Moodle 3.9.1, and it works. But you have found that exporting works from a different server.

You might want to compare your php settings (Admin | Server | php Info) between your two servers. Also, what are the database versions, the php versions, and the OS (Apache, Microsoft, etc.)

You seem to know what you are doing, so to me, you seem to have discovered a certain configuration where the exporting of users does not work. Can you export to csv or other format? Is it just a problem with the Excel format?
In reply to Mohamed Aljefri

Re: I’m not able to export user list as excel file and it’s showing un-understandable characters

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

If you open Developer Tools in your browser and go to the Network tab do you see the Content-Disposition header when you click Download:

Network tab in Chrome's Developer Tools highlighting the Content-Disposition header

It's this header that tells the browser to download the file instead of displaying it.

Could the Moodle site be behind some caching service which is affecting the HTTP headers? If so, try turning off this cache.