Storing pdf file and retrieving

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
charlisolutions

Storing pdf file and retrieving

Post by charlisolutions » 20 May 2007, 22:13

 Posted by:  charlisolutions 

Hi All,
I am storing a pdf file(file size is 1445 kb) into database and
then retriving that value and writing into other pdf file.when writing it
will store until 680 kb only.i need the size 1445 kb while writing into
other pdf file.Is there any possibility to increase the size?

I am using Centura 1.5.1 and SQL Server2005 and the column data type is
varbinary(max).

Here i have attached that apt file also.

Any suggestion would be greatly appreciated.

Regards
Poongodi
You do not have the required permissions to view the files attached to this post.

Jarmo Muukka

Re: Storing pdf file and retrieving

Post by Jarmo Muukka » 21 May 2007, 10:54

 Posted by:  Jarmo Muukka 

Hi,

Read the whole file into string. Determine the size of file by
SalFileSeek( end ), SalFileTell, SalFileSeek( begin )

Before saving/querying the file set buffer length big enough wit call to
Call SqlSetParameterAll( cursor, DBP_LONGBUFFER, 10000000, STRING_Null,
TRUE ) 10 million bytes in here

HTH,
JMu

Jim McNamara

Re: Storing pdf file and retrieving

Post by Jim McNamara » 21 May 2007, 18:24

 Posted by:  Jim McNamara 

This line is your problem:

!!CB!! 70
Call SalFileWrite ( hFile, strpdf, 700000 )

700,000 is approx = 680kb

Needs to be large enough to accommodate the file - in this example 1,500,000
should be sufficient. - Better to use Jarmo's method to handle the file size
dynamically.

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests