Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Issue with IsPDFObject() after upgrading ColdFusion 2023 from Update 10 to Update 12

Community Beginner ,
Jun 25, 2025 Jun 25, 2025

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:

  • The uploaded files have the correct .pdf extension.
  • The same files were successfully validated before the upgrade.
  • mytempPDFObj is being populated correctly but appears to be a struct always, not a PDF object.

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!

 

TOPICS
Documentation
345
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Jun 25, 2025 Jun 25, 2025

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

...
Translate
Community Beginner , Jul 03, 2025 Jul 03, 2025

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.

Translate
Community Beginner ,
Jun 25, 2025 Jun 25, 2025

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 25, 2025 Jun 25, 2025
After upload below is the check
<cfset isValidFilePath = IsPDFFile("#filelocation#")>
and then reading a file with help
        <cfpdf source="#filelocation#" action="read" name="myPDFObj"/>
        <cfset isValidPdfObj = IsPDFObject(myPDFObj)>

 isValidPdfObj is NO always
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 25, 2025 Jun 25, 2025

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? 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 25, 2025 Jun 25, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 25, 2025 Jun 25, 2025

Does it help when you replace

  <cfset isValidPdfObj = IsPDFObject(myPDFObj)>

wih

  <cfset isValidPdfObj = IsPDFObject(variables.myPDFObj)>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 25, 2025 Jun 25, 2025

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>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 25, 2025 Jun 25, 2025

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. 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 03, 2025 Jul 03, 2025
LATEST

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.

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