Reads a binary file (such as an executable or image file) on the server, into a binary object parameter that you can use in the page. To send it through a web protocol (such as HTTP or SMTP) or store it in a database, first convert it to Base64 by using the ToBase64 function.
The entire contents of a binary file.
FileReadBinary(filepath
)
FileClose, FileIsEOF, FileRead, FileReadLine, FileWrite
ColdFusion 8: Added this function.
Parameter |
Description |
---|---|
filepath |
An absolute path to a binary file on the server |
You convert the binary file to Base64 to transfer it to another site. ColdFusion 8 supports reading an image file as a binary and passing the result to a cfimage.
The following example reads a binary file.
<h3>FileReadBinary Example</h3> <cfscript> myfile = FileReadBinary("c:\testingdir\test3.jpg"); </cfscript>