YouTube CFC Temp File Fix
As detailed in my last post, we've been using YouTube CFC to communicate metadata changes between our admin and YouTube. This morning, I discovered that the stock code was creating temp XML files to send to YouTube, then deleting them right away. (Clearly, I hadn't looked at the underlying code very hard before now.)
This caused a problem for us because of the way our FTP mirroring works between our development and production servers. Essentially, the FTP software was getting confused by all the little vanishing XML files, so it was locking up and refusing to transfer any files at all.
I managed to solve this problem by commenting out 3 lines of code in the update function and adding 1 line. These got commented out:
<--- <cffile action="write" file="#tmpfile#" output="#meta#">
<cfhttpparam type="file" name="API_XML_Request" file="#tmpfile#" mimetype="application/atom+xml">
<cffile action="delete" file="#tmpfile#"> --->
I added this:
<cfhttpparam type="xml" name="API_XML_Request" value="#meta#">
Essentially, I'm telling it to send XML content instead of an XML file. This works fine, and it solved the FTP hiccup. I highly doubt anyone else will have this problem, since it's so particular to our server setup, but I figured I'd put it out there just in case.
Post new comment