Copy link to clipboard
Copied
Hi Experts,
We recently upgraded our ColdFusion 2023 environment from Update 10 to Update 12. After the upgrade, we encountered an issue in one of our applications that handles PDF uploads and validation.
Previously, we used the IsPDFObject(mytempPDFObj) function to validate uploaded PDF files, and it worked as expected. However, after the upgrade, this function consistently returns NO, even though the uploaded files are valid PDFs and were working fine before the update.
We confirmed that:
Has anyone else experienced this issue after Update 12? Is there a change in how ColdFusion handles PDF objects or MIME validation in this update?
Any insights or workarounds would be greatly appreciated.
Thanks in advance!
KK, as for your saying "filelocation is the uoloaded path which is expected", is this as of update 12? And you feel it's the correct value?
Then as for saying "myPDFObj is Data in struct" and "it's as expected always", are you saying you've dumped it? And have you compared the dumps on the two different updates? That seems worth doing.
Your current suspicion is that the function behavior has changed between updates. I'm just wanting to help you make sure THE INPUT to it is the same. 🙂
Fin
...Hi All, Thanks for all your suggestions, this issue has been resolved. Came to know that when updrage is happend server did not picked the document library versions, after refresh the caching, issue got resolved.
I belive the /bin/felix-cache also invloved in this cache refresh.
Copy link to clipboard
Copied
Hello,
Can you provide code for generating this mytempPDFObj?
IsPDFObject will return bool value depending on value you provide as argument.
Are you using <cfpdf> to generate the file or you are reading the file from path like FileRead() or <cffile> to get or generate pdf?
We had something similiar in our case when we went from CF11 to CF23 and the easiest way for us to check this was https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-in-k/ispdffile.html
Hope this helps!
Regards
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Please try first to output both the value of that filelocation variable, and then mypdfobj, to make sure both have what you'd expect. Since ispdffile expects a string argument (a path), you should see one, via cfoutput. Since ispdfobject expects and object, do a cfdump of that.
And do you know what the value of the filelocation returned before the update?
Copy link to clipboard
Copied
filelocation is the uoloaded path which is expected.
isValidFilePath is "YES" as expected
myPDFObj is Data in struct. I believe this is as expected Always.
isValidPdfObj is "NO". --- NOT as expected.
Copy link to clipboard
Copied
Does it help when you replace
<cfset isValidPdfObj = IsPDFObject(myPDFObj)>
wih
<cfset isValidPdfObj = IsPDFObject(variables.myPDFObj)>
Copy link to clipboard
Copied
Suggestion for test code:
<cfset isValidPDFFilePath = IsPDFFile("#filelocation#")>
<cfif isValidPDFFilePath>
<p>
Valid PDF file path.
</p>
<cfpdf source="#filelocation#" action="read" name="myPDFObj" />
<cfset isValidPdfObj = IsPDFObject(variables.myPDFObj)>
<cfif isValidPdfObj>
<p>
Valid PDF object.
<cfdump var="#variables.myPDFObj#" label="Dump of PDF object">
</p>
<cfelse>
Non-valid PDF object.
</cfif>
</cfif>
Copy link to clipboard
Copied
KK, as for your saying "filelocation is the uoloaded path which is expected", is this as of update 12? And you feel it's the correct value?
Then as for saying "myPDFObj is Data in struct" and "it's as expected always", are you saying you've dumped it? And have you compared the dumps on the two different updates? That seems worth doing.
Your current suspicion is that the function behavior has changed between updates. I'm just wanting to help you make sure THE INPUT to it is the same. 🙂
Finally, had you stopped cf (since going to update 12) and deleted the cfusion/bin/felix-cache folder? Sometimes the update makes changes that call for this. And though not every cf update technote, if you skip an update you have to consider steps in the technotes of the updates skipped.
Copy link to clipboard
Copied
Hi All, Thanks for all your suggestions, this issue has been resolved. Came to know that when updrage is happend server did not picked the document library versions, after refresh the caching, issue got resolved.
I belive the /bin/felix-cache also invloved in this cache refresh.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now