Archive for the ‘Coldfusion’ Category
CWheels
Thursday, August 5th, 2010
Okay, I LOVE cfwheels.
http://cfwheels.org/
If you're developing in Coldfusion I highly recommend checking out this framework. It has a great community base, the core development team are always releasing new updates - further advancing the framework. There's stacks of tutorials and podcasts - but form time to time, I'm going to start posting examples as well - simply because I want to expand the knowledge of CFWheels, and of course… Continue reading
Get filename from path
Monday, June 14th, 2010
Ever want to extract the filename from a path? C:\Inetpub\wwwroot\website\app\config\template\abc.jpg
... And not want to code something stupidly insane.
Try using #GetFileFromPath("C:\Inetpub\wwwroot\website\app\config\template\abc.jpg")#
So...
<cfset source=" C:\Inetpub\wwwroot\website\app\config\template\abc.jpg" />
<cfset fileName = GetFileFromPath(source) />
If your variable is a URL, you can't use GetFileFromPath (because it needs relative paths on your computer/network) - try using #ListAtLast("http://www.example.com/example.jpg","/")#
Once again...
<cfset source=" http://www.example.com/example.jpg" />
<cfset fileName = ListAtLast(source,"/") />…
Downloading an image from database
Friday, June 11th, 2010A project I'm working on involves storing asset references in a database and then later downloading the images. Why? because it takes bloody ages!
So assuming you have a table called Assets, and all the right fields. There's two options, using cfhttp or cfimage (cf8+).
<cfset pathToActualImage = "http://www.google.com/images/hello.jpg" />
<cfset tempFileName = "test.jpg" />
<cfset tempPath = "C:\temp\" />
<cfhttp url="#pathToActualImage#" file="#tempFileName#" path="#tempPath#">
Or
<cfimage action="write" destination="#tempFileName##tempPath#" source="#pathToActualImage#" />
I'd recommend to maybe use cfimage because
Coldfusion Server - jrun running at 100%
Thursday, May 6th, 2010
This has been a big problem with one of our servers recently. In a nutshell I'll describe what I've done to try help the situation, without really fixing the problem. Incase you're like me and don't have a huge development team or the tech resources to dedicate hours on fixing servers...
Firstly, the reason why jrun is 100%. Think of JRun as the Checkout girl at your supermarket, and dealing with… Continue reading
Adding a watermark to original images on the fly
Monday, March 1st, 2010
Found this great piece of code that will allow you to prevent users or atleast stop them a little... from downloading your images. Using the cfimage tag!
Simply use cfimage to call you're first two images, then using ImagePaste() to mash them together, and write to the browser calling '#image#'.
See how you go.
<cfimage source=”img_2566.jpg” name=”image”>
<cfimage source=”watermark.png” name=”watermark”>
<cfset ImagePaste(image, watermark… Continue reading
Query of Queries
Sunday, February 28th, 2010
Query of Queries (QoQ) is great little concept, for a while I never knew when I would ever use this up until a few months ago. Web services generally return strings, but more commonly xml. Then you have some minority that return query results. This is where QoQs work perfect, check out the code snippet below:
// Let's say qryResults has 4 columns - (Name, Address, Phone, Email)
SELECT Name, Address, Phone… Continue reading
Cfwheels
Thursday, February 11th, 2010Full transaction log on MSSQL
Sunday, January 17th, 2010
Had a big problem the other week when one of our databases was throwing heaps of exception email errors on scheduled tasks. After debugging for a few hours I worked out that the transaction log was completely full!
Check out this useful article; http://msdn.microsoft.com/en-us/library/ms175495.aspx
A useful tool is running the following command; backup log with no_log
It's also suggested you do a Maintenance Plan Wizard - http://msdn.microsoft.com/en-us/library/ms189036.aspx
I'll post more in this… Continue reading
Beginner to SVN
Monday, January 11th, 2010Fusebox 5 Community
Friday, January 1st, 2010
Join the fun! http://groups.yahoo.com/group/fusebox5
Currently there's no lead developer, and no real on-going plans for future versions as the FuseNG Project was stopped.
Although FB will live on! The community has hit back with heaps of responses it looks like there will only be patches applied to the 5.5 version.
See what the latest is by joining the group…