About
This is the M Cubed Software weblog. To find out more about us head to our about page.
Search
Feed
Archives
- June 2010
- April 2010
- March 2010
- February 2010
- January 2010
- November 2009
- August 2009
- July 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
The Perfect Download
Posted on 18/03/2008 at 05:38 PM in
One of the best bits of Code Collector Pro 1.2 is the downloading of snippets. Click on a "Send to Code Collector" link on any snippet on codecollector.net and you'll see that snippet appear in Code Collector Pro. The problem is if people want this on their website.
The ideal situation is that when someone clicks on a link to download a snippet via a 3rd party site that it will download the snippet, otherwise provide users with the ability download Code Collector or at the very least view the snippet online. Now this is what codecollector.net does, but it did require a bit out of the box thinking.
I'm not going to claim credit for this, the suggestion came from my friend Jerry Nummi (www.nummi.org). The problem is that when Safari, or any other browser for that matter, sees a protocol it doesn't recognise it starts to complain. People who don't have CCP 1.2 or higher installed will see an error, and so think there is a broken link. I tried PHP redirecting, which worked fine for people who had CCP but again failed for those without.
The solution was the humble iframe. Load the link in a hidden iframe, let the browser complain to itself and let people view the default web page. Incidentally, this doesn't work with the "Send to Code Collector" links. This is to make these links as seamless as possible. If you're wanting to link to a snippet to download directly to Code Collector Pro on your site then I urge you to use the links on the right of every snippet page.
The ideal situation is that when someone clicks on a link to download a snippet via a 3rd party site that it will download the snippet, otherwise provide users with the ability download Code Collector or at the very least view the snippet online. Now this is what codecollector.net does, but it did require a bit out of the box thinking.
I'm not going to claim credit for this, the suggestion came from my friend Jerry Nummi (www.nummi.org). The problem is that when Safari, or any other browser for that matter, sees a protocol it doesn't recognise it starts to complain. People who don't have CCP 1.2 or higher installed will see an error, and so think there is a broken link. I tried PHP redirecting, which worked fine for people who had CCP but again failed for those without.
The solution was the humble iframe. Load the link in a hidden iframe, let the browser complain to itself and let people view the default web page. Incidentally, this doesn't work with the "Send to Code Collector" links. This is to make these links as seamless as possible. If you're wanting to link to a snippet to download directly to Code Collector Pro on your site then I urge you to use the links on the right of every snippet page.