Posts Tagged cflocation

CFLOCATION Does Not Work After CFFLUSH Revisited


In my old post CFLOCATION Does Not Work After CFFLUSH I mentioned the solution to move to another template by Peter Freitag using the CFHEADER tag.

Now I’m sharing another solution that I found online (forgot where!), more elegant and geeky. That works within scheduled tasks too.

<cfscript>
local.myURL = "http://myNextURL";
getPageContext().getResponse().sendRedirect(local.myURL);
</cfscript>
Bookmark and Share

Tags: , , ,

Scripting Functions for ColdFusion 7 Users


In my work environment we have ColdFusion 7 and I like to write my templates in cfscript, but since CF7 does not support some new scripting functions in CF8, I wrote a component to mimic those functions and allow me to stay focused on the scripting.

Well, it is not my original idea, I saw it from other blogs, but I added some value to it with some additional functions.
You may download the component here

Read the rest of this entry »

Bookmark and Share

Tags: , , , , , , , , , , , ,

CFLOCATION Does Not Work After CFFLUSH


I’m writing a new import module for our real estate system where I have to read several XML files and process many photos, resizing them for the web and updating the database. Due to the amount of picture files to process, I was getting CF tag timeouts, sometimes the image tag, sometimes other tags. So instead of doing everything in one processs looping through all XML files, I decided to pick the first one up and process it, and at the end I put a CFLOCATION to call itself to process the next file until there are no file to process. 

The template worked well, did everything it had to do, but stopped at the end without calling itself to process the next file, and did not throw any error.

It took me a long time troubleshooting it, then I found an article by Peter Freitag about the tag CFLOCATION performing a client redirection where he mentioned another option of using CFHEADER to redirect:<cfheader statuscode="301" statustext="Moved Permanently">
<cfheader name="Location" value="http://www.website.com/">

That didn’t work either, but at least threw an error saying something about the page had been flushed.

Well, looking at my code I could see the several <cfflush> tags I had to track the process in real time. As soon as I took them out of the code, the template worked perfectly.

So I wrote this post just to admit my stupidity and to alert our colleagues not to use the combination CFFLUSH and CFLOCATION.

Bookmark and Share

Tags: , , ,

Get Adobe Flash playerPlugin by wpburn.com wordpress themes