Here is my bit of bad code:
<cffile action="upload" fileField="form.uploadFile"
destination="#ExpandPath(".")#" nameConflict="OVERWRITE">
<cfdump var="#cffile#"><!--- output data for
testing --->
<cffile action="readBinary"
file="#file.serverDirectory#\#file.serverFile#"
variable="myFile"><!--- read file into binary stream --->
<cfset tobase = ToBase64(myFile)>
<cfoutput>#decimalformat(Len(ToBase64(tobase))/1024)#</cfoutput>
kB
<!--- <cfif cffile.fileSize LT 46000>--->
<cfquery name="insertFile" datasource="KFS"><!---
insert to DB --->
SET TEXTSIZE 1000000
INSERT INTO TestUpload(fileName, fileType ,subType,
fileData, fileSize)
VALUES('#cffile.serverFile#','#cffile.contentType#','#cffile.contentSubType#','#tobase#','#cffile.fileSize#'
)
</cfquery>
I see using your output line that the tobase64 is working.
But when I retrive it from the DB it is always 46.8KB. So the
trouble must be in the DB. I have the table set to hold "text" and
belive it should hold up to 2 gig? any ideas why my file is getting
cut short?