xHarbour Reference Documentation > Function Reference |
Imports a file into a memo field.
BlobImport( <nFieldPos>, <cSourceFile> ) --> lSuccess
If <cSourceFile> does not exist, a runtime error is raised. If the file cannot be opened due to another process having exclusive access to the file, function NetErr() is set to .T. (true).
The return value is .T. (true) if data is successfully imported, otherwise .F. (false) is returned.
BlobImport() copies the contents of an external file into a memo field holding binary large objects (BLOB). The memo field is identified by its ordinal position, which can be obtained using function FieldPos().
Note: the file Blob.ch must be #included for BlobImport() to work.
See also: | BlobDirectGet(), BlobDirectExport(), BlobExport(), BlobGet(), BlobRootGet(), FieldPos() |
Category: | Blob functions , Database functions |
Header: | blob.ch |
Source: | rdd\dbcmd.c, rdd\dbffpt\dbffpt1.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// In this example, an image file is moved into an image // archive database #include "Blob.ch" REQUEST DBFCDX PROCEDURE Main LOCAL nFieldPos LOCAL cFileName := "Sunset.jpg" USE PhotoArchive ALIAS Photos VIA "DBFCDX" APPEND BLANK IF .NOT. NetErr() nFieldPos := FieldPos( "JPEG" ) REPLACE Photos->PhotoName WITH "Sunset in Malibu" REPLACE Photos->FileName WITH cFileName IF BlobImport( nFieldPos, cFileName ) FErase( cFileName ) ENDIF ENDIF USE RETURN
http://www.xHarbour.com