Reduce the size of database
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 !
Re: Reduce the size of database
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.
Re: Reduce the size of database
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
Re: Reduce the size of database
yea, thats a good idea. you can save zipped contents and read them as byte array.
Re: Reduce the size of database
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 ?
Re: Reduce the size of database
I use the ziplib library for compressing data. Have a look at it here.
Re: Reduce the size of database
Quote:
Originally Posted by iwtbapd
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