| **Navigation:**  [[advanced topics 1.htm|Advanced Topics]] > Clarion Language Utilities >====== FILETOBLOB (Copy data from a file to a BLOB field) ====== | [[fileexists confirm file existence .htm|{{btn_prev_n.gif|Previous page}}]][[advanced topics 1.htm|{{btn_home_n.gif|Return to chapter overview}}]][[fulldrag query change window drag setting .htm|{{btn_next_n.gif|Next page}}]] | | || **FILETOBLOB( **//filename, bloblabel //**//)//** {{blk2blue.jpg|blk2blue.jpg}} | **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 copy data from blob field to file .htm|BLOBTOFILE]] [[blob declare a variable length field .htm|BLOB]]