Bugs #2910: Loaderd binary attachments are corrupted

Ticket modified by Sebastian Steinhuber at 2011/04/05 15:25
Tracking System: Bugs
Category: Tracker
Version: Version 1.8.001
Status: Open
Resolution: None
Completed: 0%
Priority: 5 - medium
Created By: Massimiliano Ballerini
Created on: 2011/03/25 10:46
Assigned to: Ralf Becker
Summary: #2910 - Loaderd binary attachments are corrupted
We have a problem with the attachments loaded in the tracking system.

Loading a text file such as doc is good and the filed is downloaded back without problem.

When we put a zip, a rar or a 7z file as attachments they result corrupted in some way they cannot be opened again. We tried different compression tools and we had aways same problem.

We even tried on your demo site and has the same behaviour --> https://demo-epl.egroupware.de/egw/index.php?menuaction=tracker.tracker_ui.edit&tr_id=7

I think is related to the file transfer method that is not binary for those file types. Is there a way i can force binary file transfer? Haven’t found any yet.

Thanks
Comment by Sebastian Steinhuber at 2011/04/05 15:25:
Thanks, it worked like a charm.
I deleted the linked test file.
Massimiliano, set relevant options like “output compression” and “output handler” in your web server configuration to off or comment them out and restart the server.

Comment by Massimiliano Ballerini at 2011/04/05 14:32:
That did it.

How do i fix that in my installation?
Comment by Ralf Becker at 2011/04/05 14:28:
Hi,
can you try again to download the 7zip files attached to this ticket.
I switched now output compression off, for all filetypes. It was previously only done for zip files:

// switching off zlib.output_compression for zip archives, as the double compression makes problems eg. with lighttpd

// if ($options[‘mimetype’] == ‘application/zip’)
{
ini_set(‘zlib.output_compression’,0);
}

Ralf
Comment by Sebastian Steinhuber at 2011/04/05 13:51:
What is the size of the file test.r1.7z in bytes in the store of www.egroupware.org/egroupware? I would like to exclude the download mechanism’s part.
Comment by Massimiliano Ballerini at 2011/04/05 13:40:
I use mysql.

Posted in the user forum:
http://egroupware.219119.n3.nabble.com/Loaded-tracker-binary-attachments-are-corrupted-td2779539.html
Comment by Sebastian Steinhuber at 2011/04/05 13:19:
As you supposed, one should look at where those files are stored in egroupware to isolate the point of failure, and at the php part of the upload mechanism. My local installation works as expected, and files are stored in the local file-system.
Seems that some debugging would get necessary. Btw, are you using MySQL or Postgres?
Again, don’t hesitate to post this issue in the forum.

Developers, any hints?
Comment by Massimiliano Ballerini at 2011/04/05 10:37:
I did use the same method dd with /dev/urandom, just added a line of text at beginning of the file test.txt to make it readable and then compressed with p7zip, in the file test.7z

Actually can’t open your test.r1.7z either. At this point i think the problem is in the upload mechanism or in the way the file is stored in mysql, it look like the file get sliced someway.
Comment by Sebastian Steinhuber at 2011/04/04 19:17:
I did the previous mentioned test on my local installation, it worked for me.

Well, I’ve downloaded your test.7z and when I tried to open it, 7zip complained that it was no archive.
I set my browser’s preference to not use a web proxy and uploaded test.r1.7z, an 7z archive containing a file of random data (dd if=/dev/urandom of=test bs=1024 count=$((4*1024)) should not create malicious code).
The original file is 4251508 bytes, the downloaded file has 4246313 bytes in size.
So, for somewhat reason there is actually a difference.

There is also a difference in the setup, obviously.

Best,
Sebastian
Comment by Massimiliano Ballerini at 2011/04/04 14:47:
I’m using firefox 3.6.16 (but I just tied with IE8 too) and yes download work perfectly for any other site I use.

I’s not just me, every computer in the net here having problem with attachment from eg, and it’s not my installation of eg couse got the same problem on your online demo.

I made some more test and look like the problem kicks in with file over a certain size:

Tried with few KB 7z file —> working
Tried with 4MB 7z file —> corrupted

I attached a file here and got same problem, can you open the file, or it’s corrupted for you too?
Comment by Sebastian Steinhuber at 2011/04/04 12:44:
Unlike FTP, HTTP doesn’t know about a binary mode.
Download of 7z files works for me, too.
Did you download a 7z from somewhere in the net successfully?

Did you try to get help on the user list?

Comment by Massimiliano Ballerini at 2011/04/04 10:04:
I go in the links tab and click browse in the attach file section. Could you try with a 7z file instead?

I don’t know how it works, could be we don’t use winzip for zip files and egroupware don’t recognize the file type?
Comment by Birgit Becker at 2011/03/31 16:57:
Just attached a zip-file to this ticket and i was able to download and unzip it without any problems. Which was the method you tried to to upload the files?

Birgit

linked entries:
http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2910&no_popup=1