FILETOBLOB (Copy data from a file to a BLOB field)

Top  Previous  Next

 

FILETOBLOB( filename, bloblabel )

FILETOBLOB

Copy the contents of a file to a BLOB field.

filename

A string constant or variable that names the input file to copy to a BLOB field.

bloblabel

The fully qualified label of the BLOB field. (Example: Customer.BlobImage)

 

FILETOBLOB is used to copy the contents of a file to a BLOB field. If the copy was unsuccessful, FILETOBLOB returns the ERRORCODE posted.

To add support for this utility to your existing applications, you need only include the CWUTIL.INC file in the Global Map section of your program:

INCLUDE('CWUTIL.INC'),ONCE

Return Data Type:     SIGNED

Example:

IF FILETOBLOB(GLO:ImageFilename, CUS:ImageBlob)  !returns an ERRORCODE if copy fails

 MESSAGE(CLIP(GLO:ImageFilename) & ' was not copied -  ERRORCODE: ' & ERRORCODE())

END

 

See Also:

BLOBTOFILE

BLOB