Highlighted

coldfusion need to read the file and pass the bytes[].

New Here ,
Oct 11, 2015

Copy link to clipboard

Copied

need to read the file and pass the bytes[].

Can i create a java object and use it in coldfusion like below please help:

pathOb = createObject("java", "java.nio.file.Paths");

files = createObject("java", "java.nio.file.Files");

path = pathOb.get("file"); data = Files.readAllBytes(path)

Views

297

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

coldfusion need to read the file and pass the bytes[].

New Here ,
Oct 11, 2015

Copy link to clipboard

Copied

need to read the file and pass the bytes[].

Can i create a java object and use it in coldfusion like below please help:

pathOb = createObject("java", "java.nio.file.Paths");

files = createObject("java", "java.nio.file.Files");

path = pathOb.get("file"); data = Files.readAllBytes(path)

Views

298

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 11, 2015 0
Adobe Community Professional ,
Oct 13, 2015

Copy link to clipboard

Copied

Yes, you may do that. As long as the class paths are valid.

Take this basic Java object as example

<cfset str1 = createobject("java","java.lang.String").init("Bat")>

<cfset str2 = str1.concat("man")>

<cfoutput>#str2#</cfoutput>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 13, 2015 0
Advocate ,
Oct 13, 2015

Copy link to clipboard

Copied

It's worth noting that you do not have to do this in JAVA, you can use the cfFile tag in ColdFusion.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 13, 2015 0