larryclyons
07/26/2022, 5:06 PMvar workplanFile = fileUpload(uploadDir , "workPlan_file" , "application/pdf", "MakeUnique", true);
var workPlanBinary = fileReadBinary("#workPlanFile.serverDirectory#/#workPlanFile.serverFile#");
var workPlanString = binaryEncode(workPlanBinary,'base64');
Then we send it to the remote cfc.
// construct the url and send data to the server
var uri = application.uri & "com/webservices.cfc?method=XXXX";
cfhttp(method="POST", charset="utf-8", url="#uri#", multipart="true", multiparttype="form-data", result="results") {
cfhttpparam(name="Contact", type="formfield", value="#arguments.Contact#");
cfhttpparam(name="Notes", type="formfield", value="#arguments.notes#");
cfhttpparam(name="dataFileString", type="formfield", value="#workPlanString#");
}
what comes back is an exception that's mostly escaped json, but I was able to extract a few things:
C:\ColdFusionBuilder2018\ColdFusion\cfusion\runtime\work\Catalina\localhost\tmp\ (The filename or extension is too long)
then later I found this:
The cause of this exception was: java.io.FileNotFoundException: C:\ColdFusionBuilder2018\ColdFusion\cfusion\runtime\work\Catalina\localhost\tmp\MaW5lYXJpemVkIDEv....
An error occurred when performing a file operation readBinary on file C:\ColdFusionBuilder2018\ColdFusion\cfusion\runtime\work\Catalina\localhost\tmp\LdbjOQ67m+....
With some further investigation, It would appear that in the remote CFC the line that's throwing the exception is this line:
binFile = FileReadBinary(arguments.dataFileString);
At this point I am not sure what the solution is. So any suggestions would be most appreciated.
thx.
larry