Subject Re: [firebird-support] Using Firebird BLOBs with ASP to deliver web pages
Author Helen Borrie
At 02:09 PM 6/12/2004 +0000, you wrote:



>I would appreciate confirmation of the following and any relevant
>advice/pointers:
>
>We are planning to set up a website on a Windows 2000 Server system
>which uses ASP to access and deliver web pages stored in a Firebird
>database. The content of each web page is to be stored in one or more
>BLOBs as the size may exceed that of VARCHAR fields and we also need
>to store binary information, e.g. pictures, pdfs, and word-processing
>docs.
>
>Having looked at documentation on the Firebird site, Helen's book, and
>searched the support mail it appears that a SQL query or stored
>procedure will return the BLOB id but that we will need to develop a
>UDF to retrieve the BLOB content and write it to a file which the ASP
>scripts will deliver to the requesting browser. This UDF may be called
>as part of a stored procedure.
>
>Is this correct? Are there any UDFs which cover this functionality
>under the same licence as Firebird itself?

There can't be any such UDF. There are conversion UDFs but they have the
same byte limits as any varchar.


>My apologies if this has all been covered before, in which case would
>you mind pointing me in the right direction.

The right direction is to write client code (or use an existing class
interface) that reads blobs into the client app and handles them according
to your requirements. The same thing goes for passing blobs to the server
from the client. The server in fact knows nothing much at all about blobs,
except that they are blobs. For text blobs, it has a blob filter that will
output a sub_type 1 blob as text and will allow some limited string
operations on such blobs. You can store non-text objects in any blob,
including sub_type 1, and the engine won't know the difference.

If you are doing ASP in a .NET or Mono environment, your first port of call
should be the firebird-net-provider list.

./hb