PDA

View Full Version : Compressing Files To Zip Format Onto Database


edbri871
08-25-2005, 05:37 PM
We currently have files that members upload which is parsed and then put into their post. The file itself is then supplied in the post as a link for those that want to grab it. The only drawback is that the file is in raw format and a bit large. These file when compressed are substantially smaller in size. The problem is we dont know as of yet how to compress the file as like a zip or rar into the database so that it can save space and be a quicker grab for those that want it. Any info that could point us in the right direction to do this would be great.

Thanks.

Andreas
08-25-2005, 05:46 PM
Are you speking of the standard attachments system?

Marco van Herwaarden
08-25-2005, 08:50 PM
All that you could gain is a bit smaller database (or filesystem depending on storage method). When a member downloads an attachment it is already automagically compressed i think.

Andreas
08-25-2005, 09:17 PM
automagically ... nice word :D

Btw: It doesn't seem like attachments get compressed when serving them to the Client.

edbri871
08-26-2005, 03:34 PM
The files were dealing with can be around 2mb on average although if compressed theyre around 25KB which is a huge difference for the database and bandwidth also and for those grabbing them when there are numerous files. Im just looking for any way to compress the files prior to being placed in the databse. Any info would be great...

Marco van Herwaarden
08-26-2005, 03:50 PM
You could hack into the attachment system and use a compression routine on them, it might even be possible with a plugin.

Will maybe look at it monday, if nobody else provided a solution.

Andreas
08-26-2005, 07:53 PM
Upload class_createzip.php in Direcotry includes, import the product XML.