<cffunction
name="getAsPDF"
output="true"
taffy:mime="application/pdf"
taffy:default="false"
hint="serializes data as PDF" returntype="any">
<cfset local.returnVal = exportGrid("application/pdf",variables.data.query,variables.data.gridConfiguration)>
<cffile
action="readBinary"
file="#local.returnVal.filepath#"
variable="strPDFData"
/>
<cfif local.returnval.error EQ "Y">
<cfreturn "{error:#local.returnval.message#"/>
<cfelse>
<cfreturn #strPDFData# />
</cfif>
</cffunction>
API Call where ACCEPT is PDF
<cfset x.query = ResultSetData>
<cfset x.gridConfiguration = gridConfiguration>
<cfreturn representationOf(x).withStatus(200)>(I have tried .withMIME as well)
When we change it to streamFile and/or streamBinary customSerialization doesn't appear to be called and then we get error types trying to pass in the struct of our inputs to our process as it is expecting a filename and/or binary input. Unless there is a way to use streamFile with a customSerializer that I haven't read about yet?
Just wondering what others may have done to utilize the "ACCEPT" header for non-string data returns. Should we keep using the streamFile and streamBinary in each of our API calls? Thank you in advance.
--
You received this message because you are subscribed to the Google Groups "Taffy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taffy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Adam
To unsubscribe from this group and stop receiving emails from it, send an email to taffy-users...@googlegroups.com.