HTTP Headers for file downloads from websites

November 6, 2008 – by An-Min

opening fileFor a file to be downloaded (e.g., if controlled by a PHP file) from your site available with both: “Save as” and reasonable “Open with” suggestions, the following code snippet has confirmed to work reasonably well in FF and IE6.

The “cache-control” headers are for IE6’s weird bugs associated with its “Open as…” mechanism.

The “content-disposition” header tells the browser that the file is available as a download.

The “content-type” header suggests to the browser how to open the file on the user’s computer. For an unknown file type, use “application/octet-stream”.

Hopefully the following PHP could help save you from some frustrations:

header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header("Content-Disposition: attachment; filename=\"{$file_name}\"");
header("Content-type: {$content_type}");
readfile($file_name_with_path);

A basic list of content types is available at W3Schools: http://www.w3schools.com/media/media_mimeref.asp


Ecommerce Complexity for Canadians, take 2

October 16, 2008 – by An-Min

To sell something /accept credit card payments on a website,  there are 4 typical options:

  1. Simplest and least technical: use a hosted online shop solution like Yahoo! Store or Shopify
  2. Also a fairly simple method: if you already have a website, add a Buy Now button and “re-direct” the user to a payment processor, such as Paypal, for shopping cart and payments.
  3. Moderately involved method: use a shopping-cart-enable software on your site, and “re-direct” the user to a payment processor at check-out.
  4. Most complex method: allow the user to remain on your custom website for the entire shopping experience.  This require that your hosting server is SSL & at least PCI DSS level-4 compliant, then do the back-end processing through a Payment Gateway service via a custom web service (XML, SOAP, HTTP POST, etc.).  For large-volume Canadian merchants, the best deals are to go through a US service provider as described in a previous post.

For option 4, what if you don’t want to go through the US? There are some option for Canadians (e.g., Moneris), just not as many as in the US.

PayPal logoBy the way, PayPal has announced today the general availability of Website Payments Pro for Canada; they have finally decided to step up and enable the payment gateway support for Canadian merchants.  Good for them, and they are back on list.


Social media and elections

September 12, 2008 – by An-Min

Jen Hunter election

I have signed up to volunteer for Jen Hunter with her campaign for Ottawa Centre in the up-coming federal election.   I’m blogging about it to help the search engines find her site and spread the word; additionally, I hope to help with some other on-line efforts also.

For sure, the social media is becoming an important asset for the Green Party to market itself and for relevancy to younger voters.  Notably, their party leader Elizabeth May is now as part of the debate, probably in no small-part due to electronic advocacy.

Good luck Jen; you will be a great politician to help bring many positive changes.


Flex Camp Ottawa recap

August 24, 2008 – by An-Min

FlexCamp shirt

The Flex Camp Ottawa event at Adobe last Thursday was an experience to remember: well-organized, great speakers and interesting information.

While I’m no Flex developer, I was interested to see those who are in the city.  Having the top two Flash firms (Fuel Industries & Teknision) in Ottawa as presenters tipped me over to check it out.

As a software developer, I looked into Flash/ActionScript programming many years ago and concluded that I would like to make web apps using other methods.

After this conference and seeing the calibre of programming from these designers, however, I’m more warmed-up to it.  As opposed to Flash, Flex seems to be more friendly to traditional programmers, comes with a pretty good SDK, and the sample apps developed by the presenters validates its maturity and usefulness.

Here’s a spanning view of the conference room where the camp was held:

FlexCamp Ottawa

The rest of the pictures from the event are up at Flickr now.


DevShop’s Kicking the top bad habits of project management event recap

August 20, 2008 – by An-Min

 Craig presenting DevShop at Ramius Periscope

Craig Fitzpatrick of DevShop make a presentation today at Ramius as part of their Periscope - Look | Share | Learn events.

According to Craig’s analysis, there are 3 camps in the project management tool space:

- schedules-based
- collaboration-based, or
- document-centric.

DevShop’s tool is currently mainly schedules-based.

They’ve developed a framework to solve the various problems related to software project management, with the 5 main points being: times estimation error, distraction rate, schedules confidence, tasks/estimates rather than requirements/designs, and churn/context switching.  This is brilliant.

Why is it so important?  Among other things, it offers much more predictability than other models.

For example, “last week, as a developer, I was distracted (as usual) 1.5 days out of 5 to help my team mates”.  Normal project management tools would have marked me as bad developer (even though I am just being a good corporate citizen)… But, DevShop would have told you that information ahead of time and adjusted the schedules automatically. Nice, eh?

Also, the rest of the pictures from the event is on Flickr.


Enable mod_rewrite on Ubuntu server for CakePHP

August 13, 2008 – by An-Min

To have CakePHP working with pretty URLs, mod_rewrite has to be enabled.  The following is a how-to for enabling mod_rewrite for Apach2 on Ubuntu.

System info:

/etc/apache2$ cat /proc/version
Linux version 2.6.24-16-server (buildd@palmer) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Thu Apr 10 13:58:00 UTC 2008

Step 1: Enable mod_rewrite

/etc/apache2$ sudo a2enmod rewrite
Module rewrite installed; run /etc/init.d/apache2 force-reload to enable.

Step 2: Enable .htaccess overrides in the directories:

/etc/apache2$ sudo vi sites-available/default

Change AllowOverride from “None” to “All”; it should look like this afterwards:

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

Step 3: Re-start apache

/etc/apache2$ sudo /etc/init.d/apache2 force-reload
* Reloading web server config apache2        [ OK ]

Apache2 configuration is something new to me.  So, this is one of my more interesting moments…


Democamp Ottawa 9 recap

May 26, 2008 – by An-Min

It was another well-attended night at the latest Demo Camp: DemoCampOttawa9.

The presenters tonight were:

It was held at the hip Velvet Room, 62 1/2 York Street in the Market, and not at the Clock Tower Brew Pub as per usual in the recent past. Alec Saunders was the emcee for tonight’s event.

My favorite demo was the OurAirports app for the thoughtfulness of the features for its users (mainly amateur pilots).

Here are a couple of pictures from the event:

Demo Camp Ottawa 9

Demo Camp Ottawa 9


Ottawa VC Roundtable Recap

April 16, 2008 – by An-Min

Rick Segal of JLA Ventures was in town today, along with Scott Pelton of GrowthWorks Capital, for the Ottawa VC Roundtable session. Overall, it was a very informative session. The mystery surrounding why they pick certain companies to invest in has been lifted for me. Rick is awesome, and should definitely be on every software tech startup’s VCs list. The rest are my notes from the session.

VCs operate by high risk & high reward. Generally for less than $1M in funding, look for Angels. For larger sums, look for VCs.

The best time to talk to him is right after the napkins stage. Plan for 6 months, no shorter than that, to close a VC deal. The 6 months include legals, due diligence, background checks, etc. This is another reason why you need to talk to them as soon as possible.

They want “exits”; they do not want “lifestyle” companies.

Ask the VC what stage do they fund at, and what they do/don’t do.

Most VCs would like to partner with other firms. They’ll get you in front of other people. Besides, it’s also important for you to have diversified capital.

If you want VC money, set 18 months of milestones, like product in beta, a thousand customers, etc. and so that there’s a likely scenario for the company to be worth, say, $10 million.

2 types of VCs:

1. term sheet first: they’ll give you a term sheet almost immediately, but bait & switch later; essentially rip the company from you.

2. check list first: it takes longer to get a term sheet, but they move fast once the term sheet is offered.

JLA Ventures is actively involved in companies that they invest in.

They generally don’t invest in companies heavy with professional services; they like “shrink wrap” product companies for scalability and IP.

Because it’s so cheap to start a business today, there’s a lot of “noise” for similar product offerings. Anybody can have great ideas, but only the successful ones will be able to execute scale, sustainability and promotion.

Patents: process patents like Amazon’s “one-click” do not interest them; true IP patents have value, though they are not the only thing they base on.

For the future, they believe the localization is going to be huge.


A homework-inspired tip for building knowledge management portals

April 4, 2008 – by An-Min

I’m reading Alfie Kohn’s book called The Homework Myth. It triggers to me to think that many corporate knowledge management portals fails because it evolves into a type of mandatory “homework” for the participants.

Kohn suggests that “… homework… should be designed to promote two things: high-quality learning and the desire to keep learning.

Now, imagine if you take replace the word “homework” with “knowledge management”, or any other knowledge initiatives you’re responsible for. Any engagements designed with this in mind will definitely be more successful.


Not quite photo-blogging at events yet…

April 2, 2008 – by An-Min

Since my attendance at various *camps in the Ottawa area last year, I really enjoy meeting the various entrepreneurs and developers at these events. They are a great resource for people in technology.

Part of the purpose for this blog is to share my experiences at these events. One thing unique that I would like to bring is to take photos of these events and share them — to bring the readers a closer experience.

I started by taking photoes with my little point-and-shoot Canon A630. Low-light and general snap performance was not up to par, so I went out and bought an entry-level SLR, the Canon Rebel XT. It’s a great camera, but again, taking pictures at indoor events at night with the stock 18-55mm lens did not cut it either — the performance was better, but images are still blurry. I took quite a few pics at the Refresh Ottawa event, and luckily, a couple of pictures came out ok. (The write-up for that event is on StartupOttawa.com.)

Thinking it is caused of the small aperture and the hand-share, I thought maybe the 50mm lens with f/1.8 (much cheaper than a decent image stabilized lens, which is what really should work), would do the trick. The results are better, but, no cigar… The focus length provides too much zoom and does not work well for crowded indoor events.

So… at the next event, I’ll try to use the stock lens again, but jack up the ISO to the max; the pictures will be noisy, but might be good enough. Sorry to all the folks that let me take their pictures to be posted, but the pictures just don’t look nice (so I don’t end up posting them)…

Another note, in case you’re wondering… It takes a bit of time to upload pictures, process them, crop, resize and upload them to a blog… just a bit too cumbersome for an occasional blogger like me. Sigh…