Monthly Archives: September 2012

Search opening square bracket in SQL query with LIKE operator


In my previous post, I’ve identified an issue of file name with square bracket in Amazon S3 URL wasn’t opening in FireFox.

So my next job was to rename the files, and update the path in database.

I wanted to search how many path has ‘[‘ or ‘]’ bracket in file name (consider attachment as SQL table column name for convenient).

I wrote like:

WHERE attachment LIKE '%[%'

But this will not work. When I see MSDN link I came to know that % and [ are used as wild card characters, and I mixed them!!

Then I thought escaping it might work

WHERE attachment LIKE '%\[%'

Silly huh! finally I came up with following:

WHERE attachment LIKE '%[\[]%'

SignatureDoesNotMatch – Amazon S3 file opening issue in FireFox


Yesterday I see a case that my file on Amazon S3 wasn’t opening in FireFox but it was opening in Chrome and Internet Explorer 9.

The issue was character encoding. My filename was containing square bracket ‘[‘ and ‘]’.

‘[‘ converted to %5B and ‘]’ converted to %5D

So I learned a lesson to replace special characters.