FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Zip file corruption
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Zip file corruption [message #25335] Tue, 07 June 2005 03:05 Go to next message
cstdenis is currently offline  cstdenis   Canada
Messages: 17
Registered: April 2005
Karma: 0
Junior Member
Zip file downloads are getting corrupted.

Additional data is being added before the normal header.

Origional header:
PK
セ2  Air/PK  尅2Y・ヨ 瑟 

Header from downloading from fudform
・  "€ンPK
セ2  Air/PK  尅2Y・ヨ 瑟 

for some reason "・  "€ン"is being pre-pended.

this extra data does not appear to exist on the file stored on the server.


apache2 php5 FUDforum 2.6.12.
Re: Zip file corruption [message #25498 is a reply to message #25335] Fri, 10 June 2005 06:01 Go to previous messageGo to next message
cstdenis is currently offline  cstdenis   Canada
Messages: 17
Registered: April 2005
Karma: 0
Junior Member
Anyone?
Re: Zip file corruption [message #25573 is a reply to message #25498] Tue, 14 June 2005 02:58 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Does it occur with 2.6.13?

FUDforum Core Developer
Re: Zip file corruption [message #25578 is a reply to message #25335] Tue, 14 June 2005 06:12 Go to previous messageGo to next message
cstdenis is currently offline  cstdenis   Canada
Messages: 17
Registered: April 2005
Karma: 0
Junior Member
Yes, and the upgrade script broke my forums pretty badly because my users table is a view.

finally got it working again, but lost all of my forum categories somehow.

feature request: include views when checking which tables exist during an upgrade and during consistancy check.
Re: Zip file corruption [message #25581 is a reply to message #25578] Tue, 14 June 2005 13:17 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well, you are using a non-standard forum SQL schema, you can't honestly expect the stock upgrade script to be aware of that...
More over, views are database specific feature that MySQL does not support for example, so no...


FUDforum Core Developer
Re: Zip file corruption [message #25584 is a reply to message #25335] Tue, 14 June 2005 17:07 Go to previous messageGo to next message
cstdenis is currently offline  cstdenis   Canada
Messages: 17
Registered: April 2005
Karma: 0
Junior Member
Quote:

views are database specific feature that MySQL does not support.

I don't see what MySQL's limited SQL support has to do with this. Anyway, mysql 5 supports views.

All it requires is to change the else statement here
        if (__dbtype__ == 'mysql') {
                $c = q("show tables LIKE '".str_replace('_', '\\_', $GLOBALS['DBHOST_TBL_PREFIX'])."%'");
        } else {
                $c = q("SELECT relname FROM pg_class WHERE relkind='r' AND relname LIKE '".str_replace('_', '\\\\_', $GLOBALS['DBHOST_TBL_PREFIX'])."%'");
        }

to
                $c = q("SELECT relname FROM pg_class WHERE (relkind='r' or relkind='v') AND relname LIKE '".str_replace('_', '\\\\_', $GLOBALS['DBHOST_TBL_PREFIX'])."%'");


on line 291 of the upgrade script.

Quote:

Well, you are using a non-standard forum SQL schema, you can't honestly expect the stock upgrade script to be aware of that...

Well, I kind of expected the "Have you manually modified FUDforum's SQL structure?" checkbox to do something.


Anyway, back on topic, any other ideas regarding the header garbage being added to downloads from my forum?

Edit: this is what the extra header data looks like in hex:
1F 8B 08 00 00 00 00 00 00 03 00 2A 80 D5 7F

[Updated on: Tue, 14 June 2005 17:23]

Report message to a moderator

Re: Zip file corruption [message #25589 is a reply to message #25584] Tue, 14 June 2005 20:41 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Ok I see the issue with views now, I've added a patch that should hopefuly resolve that problem.

As far as attachment data, check if the uploaded files have it @ the top, the getfile (download) just does a readfile() on the data so it does not modify the content in any way.


FUDforum Core Developer
Re: Zip file corruption [message #25604 is a reply to message #25335] Wed, 15 June 2005 02:35 Go to previous messageGo to next message
cstdenis is currently offline  cstdenis   Canada
Messages: 17
Registered: April 2005
Karma: 0
Junior Member
No, the files on the server do not have it. Also a fetch (BSD equiv of wget) also does not seem to get the header.

I have apache2 configured with compression which I'm thinking now may be the cause. Are any mime headers added when downloading files like that? Maybe there should be.
Re: Zip file corruption [message #25605 is a reply to message #25604] Wed, 15 June 2005 02:42 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
On file downloads the forum sends 3 headers:
Content-Type:
Content-Disposition:
Content-Length:


FUDforum Core Developer
Re: Zip file corruption [message #25611 is a reply to message #25335] Wed, 15 June 2005 07:04 Go to previous messageGo to next message
cstdenis is currently offline  cstdenis   Canada
Messages: 17
Registered: April 2005
Karma: 0
Junior Member
Further testing strongly suggests that it is the mod_deflate.

I have my mod deflate set as follows
AddOutputFilterByType DEFLATE text/html text/plain text/xml
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|dimg)$ no-gzip dont-vary

Can the file name attachments come from be reasonably easily changed (I have .dimg setup for my php generated thumbnails)?

Is there an easy way to add an appropriate mime header so it isn't detected as text/plain or text/html?
Re: Zip file corruption [message #25613 is a reply to message #25611] Wed, 15 June 2005 12:17 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Unless the content in plain text the getfile will add mime-header indicating that it is something else, that's what the Content-Type header sent by PHP does.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Time Zone
Next Topic: Messages scrambled/Consistency check error
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Jun 26 05:17:31 GMT 2024

Total time taken to generate the page: 0.03868 seconds