We have a web application, which uploads pdf files into Sybase database. These PDF files can be opened and viewed from the website.
The application stores the PDF files into an image data type column of a Sybase table(ASE11.9.2). Some of the PDF files are getting truncated and are not opening when viewed from the web site. The Sybase DB is on an UNIX machine. We use an O' Reilly component for uploading the PDF files to the server's file system and then we use PreparedStatement to load the PDF file into the database.
Most of the PDF files are uploading properly and while downloading, open without problems. But a few files give problems. The last part of these files get truncated.
For eg, one pdf file which is 981,468 bytes long gets stored only upto 980,992 bytes. We did a file compare of the two files (the file before uploading and the downloaded one from the database), we find that the last few lines of this file gets truncated while storing in the database. Hence, when we open this file after downloading, we get the msg "There was an error opening the document. Could not repair file - acrobat reader"
There is no problem with the size of these files as files as large as 5 MB gets stored properly. This problem occurs only for a few pdf files.
There is no problem with the O'Reilly component (used for uploading) either, because the file gets stored properly in the server's file system after uploading. The problem occurs only when it is stored in the database (which uses PreparedStatement).
I have the same problem, but in my case i upload a file which is 50kb and only store only 16 kb, this occure with any file (pdf, xls, doc, txt) i test that using jConnect30 and jCon12 and the problem continue. I apreciate any help, thanks.