Loading...
 
Features / Usability

Features / Usability


Data corruption in attached files

posts: 26

When I attach a gzipped tar file (name.tgz) to a wiki page, the downloaded version is corrupted. When I do the same with a .pdf file the downloaded version is fine.

I have configured files to be stored in a directory, and the file in that directory is correct (only one file with the right length). So the problem is in downloading, not attaching.

This is strange: when I created "test.tgz" as a 2-line ASCII file, attached and downloaded it, it came back corrupted. When I renamed it to "test.txt" and re-attached/downloaded it it was corrupted in a different way. Yet other .txt files are OK.

This is so basic — I must be doing something very wrong!

This is TikiWiki 1.9.4.

What's wrong? How can I fix it? Why haven't hundreds of other people reported this???

posts: 26

> When I attach a gzipped tar file (name.tgz) to a wiki page, the downloaded version is corrupted. When I do the same with a .pdf file the downloaded version is fine.

I'm testing with two copies of a valid .tgz file: name.tgz and name.zap; both were attached to a page and then downloaded (saved to disk using Firefox). On the server disk, both files are identical and correct. Ethereal watching the downloads shows they come down with different data. So this must be some interaction between the Content-Type header and the readfile() PHP function. But the PHP documentation gives no hint of such an interaction....

name.tgz gets Content-Type:application/x-gzip and fails; name.zap gets Content-Type:application/octet-stream and works. Other than filename and date that's the only difference in the HTTP headers; the data differs.

I now suspect the problem is really during the attach/upload, where the Content-Type is determined. And also, a 380 kbyte .txt file fails uploading (with a strange error that makes me think its length was incorrect).

Anybody have a clue?

posts: 26

I just discovered that when I turn off "Use gzipped output" in Administration::general that the .tgz files download fine.

This appears to be a workaround — I'll have to test other file types....

posts: 1630 Canada

>
> This appears to be a workaround — I'll have to test other file types....

Hi tjrob!

Thanks for your detailed testing. This will produce a great bug report si we can solve this.

Best regards,

M ;-)


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting