Re: Data corruption in attached files
> 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?