Bulk User Action downloads corrupt?

Bulk User Action downloads corrupt?

by Tim H -
Number of replies: 14
I wanted to export an Excel sheet of my users in 1.95+ today using the Bulk User Actions.

After selecting users to include in the download, I chose "Download in Excel Format" and the results do not prompt me to download a file, but rather display jibberish that looks like this:

������������������������ ���!���"���#���$���%���&���'���(���þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ���» ÌA������B��ä=������¼%r8������X.....

And on...

Has anyone experienced this and if so, do you know how to fix it? Is it a permission problem.

Thanks for any help!

-Tim
Average of ratings: -
In reply to Tim H

Re: Bulk User Action downloads corrupt?

by José Ángel Polo -
Two months ago I had the same problem in mdl 1.9.3

Interestingly I create a new role with permissions create and delete users, update and edit user profile, and it allows me to download the excel, using a user you assign this new role.
In reply to Tim H

Re: Bulk User Action downloads corrupt?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Tim - I just tried it and I am not having this probem. By chance do you have a custom user field or something with a URL in it? I have experienced a problem with the Excel exporting of URLs. You can check out MDL-19864 for more information on that. There is the URL field in the user profile which may be causing it. I'll comment on the tracker issue but you may want to follow that. A workaround I found for this was to add an introductory space when creating the file. I would have to look and see where this is. I'll add information about your post to the tracker issue as they seem related. Peace - Anthony
Average of ratings: Useful (1)
In reply to Anthony Borrow

Re: Bulk User Action downloads corrupt?

by Tim H -
I do have custom profile fields but none that contain a URL. Perhaps one of those fields are causing the problem, but I could not see why since they are just "input text" custom profile fields.
In reply to Tim H

Re: Bulk User Action downloads corrupt?

by Jo Matthews -

Tim,

I've had this problem before and resolved it by turning debugging on and then selecting Admin>Users>Accounts>Bulk user actions>Download>excel,  For me, It displayed an error message about headers already being
sent and the name of the file that is causing the problem. Edit that file and
remove any LF chars at the end of the file. You get these extra LF's sometimes
when you copy the file from a windows machine to linux.

In reply to Jo Matthews

Re: Bulk User Action downloads corrupt?

by Tim H -
I did as you suggested and turned on the Debugging feature. This is what outputted

Warning: Cannot modify header information - headers already sent by (output started at public_html/mod/ilpconcern/lang/en_utf8/ilpconcern.php:151) in /home/mooadmin/public_html/lib/pear/Spreadsheet/Excel/Writer.php on line 68

I didn't notice any LF characters though.

I'm stumped.

Thanks it appears I'm getting closer...
In reply to Tim H

Re: Bulk User Action downloads corrupt?

by Jo Matthews -

Hi Tim,

try this:

open

/home/mooadmin/public_html/lib/pear/Spreadsheet/Excel/Writer.php

in any text editor and move your cursor to the end of the file, you won't see the LF chars but will probably notice blank lines after the last line of code. Press the backspace key to remove any blank lines (be careful not to delete any code) and save the code. Do the same for public_html/mod/ilpconcern/lang/en_utf8/ilpconcern.php.

It is these extra blank lines that is causing the problem

Let me know how it goes

In reply to Jo Matthews

Re: Bulk User Action downloads corrupt?

by Tim H -
Hi Jo,

Still no luck on that. There were a couple of LF's on the mod/ilpconcern/lang/en_utf8/ilpconcern.php. file so I deleted those using Notepad and re-uploaded. Still no luck.

I'm able to download other Excel files throughout the site, but just not through the Bulk User Actions area.



In reply to Tim H

Re: Bulk User Action downloads corrupt?

by Jo Matthews -

When you say "re-uploaded" do you mean you downloaded the file, edited in with a windows text editor and then re-uploaded? What do you use to upload the files. I ask because if you're using winscp, uploading/downloading the file can cause these linefeed chars to be appended to the end of the file but this behaviour can be disabled. If you download the file again, are the extra LF's back?

In reply to Jo Matthews

Re: Bulk User Action downloads corrupt?

by Tim H -
Correct. I'm using FileZilla. When I re-download it doesn't add the LF's on there again.

One thing I did notice is that it is happening through the same hosting company. I have two instances of Moodle on two different servers through the same hosting company and this happens on both of the installations.

Could there be a setting or permission that is not allowing this to go? Any ideas?
In reply to Tim H

Re: Bulk User Action downloads corrupt?

by ces moce -
i have the same pb , does anybody found a solution?

Thanks
In reply to Tim H

Re: Bulk User Action downloads corrupt?

by Benjamin Young -
Hi Tim,

This maybe useful.

I had the same issue and was able to correct the issue by removing the LF characters (lines) from an installed module which was causing the issue.

moodle\mod\udutu\lang\en_utf8\udutu.php:158
In reply to Tim H

Re: Bulk User Action downloads corrupt?

by ces moce -
Is there a solution to these problem?
In reply to ces moce

תשובה ל: Re: Bulk User Action downloads corrupt?

by Miki Alliel -
Picture of Translators

this worked for me

just delete extra spaces in the end of each file which is listed in the debug mode

and it will fix the problem

In reply to Miki Alliel

Re: תשובה ל: Re: Bulk User Action downloads corrupt?

by Randy Craps -

I found it by using debugging...

It was a theme, educator. I deleted the theme and now it works....