Ask a Jedi: Saving a Dump for Later

This post is more than 2 years old.

Ok, I have to admit - the four year old in me wrote that title. The cfdump is the single most useful tag in ColdFusion. But what if you want to use it and store the result for later? Don't forget one of the other extremely useful ColdFusion tags: cfsavecontent. For example:

<cfsavecontent variable="thedump"> <cfdump var="#application#" label="The Application Scope"> </cfsavecontent>

This will take the entire dump and store the result in a string named thedump. Then you can use cffile to save it to the file system. If you do, I'd suggest saving it as an HTML file since cfdump contains a lot of HTML. Kind of like how the galaxy has a lot of stars. You can also cfmail it as well. Just remember to use HTML mail.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate for HERE Technologies. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA