epipko
04/07/2022, 4:14 PM<cfif isJSON(\\server\c$\Temp\returnly_json.txt)>
, I am getting this error: Invalid CFML construct found on line 85 at column 18.
ColdFusion was looking at the following text:
//
. What am I doing wrong?Myka Forrest
04/07/2022, 4:18 PMMyka Forrest
04/07/2022, 4:19 PMepipko
04/07/2022, 4:28 PM<cfif isJSON("\\server\c$\Temp\return.json")>
saying it's not a valid Json formatMyka Forrest
04/07/2022, 4:29 PMepipko
04/07/2022, 4:32 PM{
"data": [
{
"type": "returns",
"id": "327031",
"attributes": {
"rma": "327031",
"ext_store_id": null,
Myka Forrest
04/07/2022, 4:33 PMScott Bennett
04/07/2022, 4:34 PMScott Bennett
04/07/2022, 4:35 PM<cfscript>
isJson(FileRead("\\server\c$\Temp\return.json");
</cfscript>
Scott Bennett
04/07/2022, 4:38 PM<cfscript>
myfile = FileRead("\\server\c$\Temp\return.json");
if (isJSON(myfile)){
//do some stuff with the json
}
</cfscript>
epipko
04/07/2022, 4:42 PMepipko
04/07/2022, 4:42 PM<cfscript>
myfile = FileRead("\\server\c$\Temp\return.json");
</cfscript>
<cfif isJSON(#myfile#)>
<cfset jsonData = deserializeJSON(#myfile#) />
<cfdump var="#jsonData#"><!--- <cfabort> --->
</cfif>
Myka Forrest
04/07/2022, 4:42 PMepipko
04/07/2022, 4:43 PMMyka Forrest
04/07/2022, 4:44 PMepipko
04/07/2022, 4:44 PMMyka Forrest
04/07/2022, 4:45 PMepipko
04/07/2022, 4:45 PMMyka Forrest
04/07/2022, 4:46 PMepipko
04/07/2022, 4:47 PMScott Bennett
04/07/2022, 4:47 PM<cffile action= "Read" file="\\server\c$\Temp\return.json" variable="myfile">
<cfif isJSON(#myfile#)>
<cfset jsonData = deserializeJSON(#myfile#) />
<cfdump var="#jsonData#"><!--- <cfabort> --->
</cfif>
Scott Bennett
04/07/2022, 4:47 PMScott Bennett
04/07/2022, 4:48 PMepipko
04/07/2022, 4:48 PMepipko
04/07/2022, 4:48 PMScott Bennett
04/07/2022, 4:48 PM