Here is the code to zip multiple files and compress them using ColdFusion and Java. I tested it using two picture files and two text files.
I didn't find a whole lot on the web about this, aside from http://www.petefreitag.com/item/68.cfm. When migrating ColdFusion MX 7, it is good to know that the settings, including data sources, are stored in *cf_root*\lib in neo-*x*.xml files.
For example, all of the data sources can be found in neo-query.xml. If you're migrating a server to the same version of ColdFusion, I don't see why this wouldn't work. You should be able to save the old file(s) on the new installation and drop the new file in there. I would shut the service off and start again when finished.
I get into work today and have a help desk ticket stating that the time on our servers is off. Well, not quite.
The issue is the time in ColdFusion does not match the time the servers have. We "sprang forward" on Sunday, March 9th, but any time functions reported the time one hour behind. ColdFusion, it seems, forgot to spring.
Using ColdFusion, I was able to solve this problem. I believe this can be done in any language which allows the setting and manipulation of cookies. Here is the code:
<cfset jscript = 0>
I had an unusual problem to solve today. One of my applications generates signed documents using Microsoft Word. The user clicks a button and is prompted to open or save the word document. The signatures are important ones, and stored outside the webroot.
I solved this by referencing a coldfusion file in the src attribute of the image tag in the html that outputs the document. The file is called dynpic.cfm. So the image tag looks like this:
<img src="https://someserver.someschool.edu/production/someapp/dynpic.cfm?pic=chair" />
I needed a quick tag to detect if the page the tag resided in was called using a secure URL. Unfortunately, the CGI function was not easily found, so here it is.
<cfif CGI.HTTPS EQ "off">
<cfset NewLink = "https://" & #CGI.HTTP_HOST# & #CGI.PATH_INFO#>
<cfif #CGI.QUERY_STRING# NEQ "">
<cfset NewLink = NewLink & "?" & #CGI.QUERY_STRING#>
I know some of you have been dying for code (yeah, right) so here's a small function I made for parsing an IP address. I needed the last byte to determine if the machine calling the page was a developer's machine or not.
<cfset BegPos = 1>
<cfset EndPos = 1>
<cfset ip = #CGI.REMOTE_ADDR#>
<cfset ByteArray = ArrayNew(1)>
<cfloop index="i" from="1" to="4">
<cfset EndPos = #FIND(".", ip, BegPos)#>
<cfif EndPos GT 0>
<cfset ByteArray[i] =