Alright, this one's fun. Lucee 6.1.1.118, a bug in...
# lucee
a
Alright, this one's fun. Lucee 6.1.1.118, a bug in saving PDFs generated from POST requests, but not GET requests. Chrome shows this error and Firefox doesn't, so maybe it's not even Lucee's fault but I'm not sure what to do about it.
pdftestcase.cfm
Copy code
<cfdocument
    format="PDF"					
    fontEmbed="yes"
    pageType="letter"				
    localurl="yes"
    saveAsName="mytestcase.pdf"
>
<h2>Hi!</h2>                            
</cfdocument>
pdftestcasewrapper.cfm
Copy code
<form action="pdftestcase">
    <input type=submit value="Success">
</form>

<form action="pdftestcase" method=post>
    <input type=submit value="Failure">
</form>
Repro: Click success, save the PDF to drive -- PDF is correctly named, file is generated locally. Click failure, save PDF to drive -- PDF is incorrectly named, file is not generated locally, network error is in download panel. Chrome 132.0.6834.130: fail Firefox 134.0.2: success
Opened https://luceeserver.atlassian.net/browse/LDEV-5289 , though I suppose if it's closed because "what do you expect us to do about it" that's fair enough.
q
Are you doing any anti-caching tags or etags in the request?
a
Nope.
There's not even a LB on the server I built the test case on, it's just a very boring nginx.
q
Take a look at the headers in Chrome in dev view. Does it have no-cache headers or an eTag listed?
a
The server response has neither.
q
In the page you use to call the CF to generate the PDF, can you add an anti-cache tag? e.g. put ?date=546541654651 or something random in the page call? I've seen similar where Chrome is not acting like it supposed to be when you change content-types
a
Modification to...
Copy code
<cfoutput> 
<form action="pdftestcase?cache=#CreateUUID()#" method=post>
    <input type=submit value="Failure">
</form>
</cfoutput>
Made no change when hitting
pdftestcase?cache=49E62EB6-EB28-484D-9152D80E42E70C15
.
q
Are you getting the same corrupted file if you test it from Postman?
a
To be honest I'm not sure it's a corrupt file at all -- it works, after all, in Firefox.
Hmm, I don't have a really fast way to answer that question this minute though.
Yes, everything comes down fine with Postman.