Click to See Complete Forum and Search --> : Reduce the size of database
iwtbapd
September 2nd, 2008, 10:12 PM
I have some problem with database size.
I have an table with a blob field ( i use firebird ) .
I have to insert a .RTF file into blob field. So i have read file .RTF into an array of bytes, then insert it into database.
But the problem is the size of []bytes so large.
Is there anyway to reduce the size of database .
Is there anyway to compress file before insert
Please help me !
Regard !
boudino
September 3rd, 2008, 01:39 AM
You store the rtf separatelly in the filesystem and in the database, you store only "pointer" (guid, path... whatever meets your needs) to the file.
iwtbapd
September 3rd, 2008, 02:54 AM
Thank for your idea . But i can't do that way.
i have to bring rtf file into database.
Would you suggest me some way to read a zip file. And then, how to read it again
nabeelisnabeel
September 3rd, 2008, 03:17 AM
yea, thats a good idea. you can save zipped contents and read them as byte array.
iwtbapd
September 3rd, 2008, 03:55 AM
I got byte array from blob field, but dont' know how to decompress it and convert it into a string .
I tried GZipStream class but it seem wrong method . Would you please give me some more suggestion ?
torrud
September 3rd, 2008, 05:01 AM
I use the ziplib library for compressing data. Have a look at it here (http://www.icsharpcode.net/OpenSource/SharpZipLib/).
JonnyPoet
September 3rd, 2008, 05:39 AM
I got byte array from blob field, but dont' know how to decompress it and convert it into a string .
I tried GZipStream class but it seem wrong method . Would you please give me some more suggestion ?GZipStream has an overhead relatively big, so its only from interest if you have really great files. For example some 100-drets of KB
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.