This topic is locked

How do you control the textsize for mssql

5/1/2008 10:49:33 AM
PHPRunner General questions
S
steveh author

I'm using phprunner on a windows server, I see that the connection is using the ADODB COM object, how do you control the textsize for this?
I'm asking as my file downloads are all coming back at 4k which is the default.

Sergey Kornilov admin 5/1/2008

What's the field type and size in the database?
I recommend to use IMAGE datatype for this purpose.

S
steveh author 5/1/2008

Hi,
yes it is of type image already.
I think the issue is that the default textsize is 4096, if the access were by the builtin mssql then I'd just increase mssql.textsize in the php.ini but this is using ADODB as a COM component.
In our existing app we have a "set textsize nnnnnnn" as part of the open before we execute any queries where nnnnn is the maximum filesize we will support.
What's the recommended way to change thuis for phprunner as I'm sure people aren't all downloading 4k files?

Sergey Kornilov admin 5/1/2008

For some reason it works just fine with all default settings on Windows XP, SQL Server 2005 and PHP 5.

I don't think you need to change anything in PHPRunner.

S
steveh author 5/2/2008

Very strange.
We're running php 5.2.5, Windows Server 2003 and SQL 2000.
I've added a select of @@TEXTSIZE to the query and that looks fine, it's larger than our filesizes that we're trying to download.
The table does contain these files, I can confirm this by downloading them using our existing php application and they end up the correct size.
I'll add a select of datalength to the query as well to make sure this is correct.
As far as I can see, either the field is being truncated or the length on the header is being calculated incorrectly.
I'll add some debug to get_file to see which of these it is.

S
steveh author 5/2/2008

datalength(filedata) is returning 4096, looks like it's a problem our end on the database.
I'll post the eventual solution here when I find it!

S
steveh author 5/2/2008

And I'm really sorry, this was a complete red herring.
The very early entries on our original database from years back (which happen to be the ones on the first page of my test phprunner application) are truncated in the database.
Not sure whether you want to delete this topic as it adds nothing to phprunner!!!!!
Downloading one of the good ones works perfectly, thanks.