Created
April 23, 2012 16:48
-
-
Save cfjedimaster/2472221 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
Note - should add some logic to ensure file was properly image - can't trust the client | |
---> | |
<cfsetting showdebugoutput="false"> | |
<cffile action="upload" filefield="afile" destination="uploads" nameconflict="makeUnique"> | |
<cfset dataURL = "data:" & "image/" & cffile.clientfileext & ";base64," & toBase64(fileReadBinary(cffile.serverdirectory & "/" & cffile.serverfile))> | |
<cfset result = {"name":cffile.clientfile, "type":cffile.contenttype,"dataUrl":dataURL,"username":form.username,"accountnum":form.accountnum}> | |
<cfcontent type="application/json" reset="true"><cfoutput>#serializeJSON(result)#</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment