NetTalk Central

Author Topic: Blobs  (Read 3427 times)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Blobs
« on: April 14, 2015, 05:07:06 AM »
Hi,

Anyone serving files out of a MSSQL blob field in the _sendfile method?

I have saved a jpg to the blob field and in the _sendfile method check if it is being requested and try to serve it up using the following code from example 40...

loc:found = BF:Bin{prop:size}
sendstring &= new(string(loc:found))
sendstring = BF:Bin[1: loc:found]
self._SendMemory(sendString,loc:found)
dispose(sendString)


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Blobs
« Reply #1 on: April 14, 2015, 07:22:14 AM »
I think the one line should read;

sendstring = BF:Bin[0: loc:found-1]

cheers
Bruce

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Blobs
« Reply #2 on: April 14, 2015, 03:07:47 PM »
Hi Bruce,

Is this different than the example because it is stored in a SQL DB?

Cheers,

Kev

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Blobs
« Reply #3 on: April 14, 2015, 09:20:16 PM »
no, it's a bug in the example...

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Blobs
« Reply #4 on: April 14, 2015, 10:23:34 PM »
and the book if you are working on a revised edition...