How to enable FLV file playback in IIS 6

Problem: This one crops up every-so-often, and a colleague just asked me again, so it’s probably worth posting. When an FLV is loaded into a Flash app, the FLV file is ‘played’ when the SWF or Projector is run. When this is done locally – i.e. you run an SWF from your hard drive, or file server – it’ll work fine. The problem comes when you upload it to your IIS web server. The server probably won’t recognise the ‘.flv’ filetype, so it’ll display nothing.

Solution: To make your IIS 6 web server aware of FLV files, do the following:

  • Open ‘IIS Manager’.
  • Right click on your site in ‘Web Sites’, and select ‘Properties’.
  • Choose the ‘HTTP Headers’ tab.
  • Click the ‘MIME Types…’  button on the bottom-right.
  • Click ‘New…’ and then add ‘.flv’ and ‘video/x-flv’ as shown below:
Setting FLV Mime type in IIS site properties
Setting FLV Mime type in IIS site properties
  • ‘Ok’ your way out, and ‘Apply’ when needed.
  • Your video should now play in a browser when embed in an SWF.
Note: You might have to stop and start ISS, but I didn’t when I added the Mime type a few hours ago.
Questions? Please leave a comment…

Please let me know if this post was useful with a click!
Nope, not helpful...Yep, more useful than not! (No Ratings Yet)
Loading...

Textpad Regular Expressions

TextPad is a great editor, been using it for years, but never really used it to it’s full potential. Recently I needed to do some find/replace work in some huge SQL and CSV files – huge enough to make manual editing impossible – so I had to start using Textpad’s Regular Expression capabilities.

Here are a few expressions that came in handy. I intend to add to this list as time goes on.
Regexp shown in Green, my comments in Red:

CSV Editing:

Remove spaces and tab characters at the beginning of a line:
Find what: <span style="color: #008000;">^[ t]+</span> Replace With: <span style="color: #ff0000;">don't enter anything in the field</span>
Remove spaces and tab characters at the end of a line:
Find what: <span style="color: #008000;">[ t]+$</span> Replace With: <span style="color: #ff0000;">don't enter anything in the field</span>
Add “Hello” to the beginning of every line:
Find what: <span style="color: #008000;">(^.*)</span> Replace With: <span style="color: #008000;">Hello 1</span>
Add “Hello ” to the beginning and ” World” to the end of every line:
Find what: <span style="color: #008000;">(^.*)</span> Replace With: <span style="color: #008000;">Hello 1 World</span> <span style="color: #ff0000;">(watch the spaces)</span>
Find empty fields (i.e. “, ,”) with spaces or tabs in, and replace with empty field (“,,”):
Find what: <span style="color: #008000;">,[ t*],</span> Replace With: <span style="color: #008000;">,,</span> <span style="color: #ff0000;">(just that, nothing else, just 2 commas)</span>
Remove blank lines in a text file, by searching for two linebreaks next to each other, and replacing with one:
Find what: <span style="color: #008000;">nn</span> Replace With: <span style="color: #008000;">n</span>

Replacement Expressions:

Extract email addresses only from the following text: “Joe Blogs (job.blogs@blogsworld.com)”
This expression searches for 2 tagged expressions, firstly any printable characters including spaces up to the first open bracket symbol, secondly anything between the brackets. It then replaces the whole line with the second match.
Find what: <span style="color: #008000;">^([[:graph:] ]+)(([[:graph:] ]+))</span> Replace With: <span style="color: #008000;">2</span>

Submitted by Paul: “Here’s how to convert csv to xml with a (quite large) regexp you can alter/extend for your needs.”
Find what: <span style="color: #008000;">^"([[:print:]]+)","([[:print:]]+)","([[:print:]]+)"</span> Replace With: <span style="color: #008000;">123</span>

Notes:

  • The expressions above need the ‘Regular Expression’ condition to be ticked in the Find or Replace dialogue boxes for them to work.
  • Text pad needs to be set to use UNIX not POSIX style expressions. To set this, open ‘Configure > Preferences’ (Ctrl+Q,P), find the ‘Editor’ settings, and untick the ‘Use POSIX regular expression syntax’ box.

Please let me know if this post was useful with a click!
Nope, not helpful...Yep, more useful than not! - +23 thumb, 25 overall.
Loading...

Centre and float a div over page content with CSS – no hacks, cross browser

Problem

If you need to center a div (or any another block element) over the rest of the content in a page, and you need it to be cross-browser and valid (CSS and XHTML)…

Solution

Try the following CSS in your stylesheet or page head:

#cdiv {
  position:absolute; /* important. */
  left:50%; /*important if you want it absolutely centred in window. */ 
  margin-left:-50px; /* importnant. must be half the width. */
  width:100px; /* set to your requirements, but remember left margin setting. */
  height:100px; /* not neccessary if the element needs to grow with content. */
  border:1px solid #ABF; /* not important. */
  background-color:#DDF; /* not important. */
  text-align:center; /*not important. */
}

… and now set the ID of the element you want centered to ‘cdiv’. If the item you want to centre is an image, remember to add display:block; to the style (this makes it act like a block level element).

This style works perfectly (by my testing, but I’m not perfect) on:

  • Internet Explorer 6, 7 & 8+
  • Firefox 2.*+
  • Opera 8 & 9+
  • Google Chrome (all versions)
  • Safari (Mac and PC versions)
  • Netscape 9 (is anyone still using this?)
Any problems, please post a question or comment below.

Please let me know if this post was useful with a click!
Nope, not helpful...Yep, more useful than not! (No Ratings Yet)
Loading...

Vista Driver for HP Photosmart 1215…

Problem

Yesterday my father-in-law needed to hook his old HP Photosmart 1215 Inkjet to Windows Vista Home Edition. HP don’t provide a Vista driver for the 1215…

Solution

A quick search around the web found that the driver for the Photosmart 7200 works perfectly. He tried it and says it works exactly as it should.

To install the diver use the following steps:

  1. Click the ‘Start’ Icon, and select ‘Control Panel’ in the start menu.
  2. Once the Control Panel window opens, double-click the ‘Printers’ icon.
  3. In the ‘Printers’ window, click the ‘Add a printer’ icon/link in the top menu bar.
  4. In the ‘Add Printer’ dialog window, select ‘Local Printer’ and ‘Next’.
  5. When asked to ‘Choose a Printer Port’, select ‘Use an existing port’ and click on the ‘USB001 (virtual printer port for USB)’ item in the list. Then click Next.
  6. On the following page, select ‘HP’ or ‘Hewlett Packard’ in the left pane, and find ‘Photosmart 7200′ in the list on the right.
  7. IMPORTANT: Plug in the Printer now, if it’s not already plugged in, and switch it on.
  8. Click ‘next’ and then print a test page.

That should do it…

Please let me know if this post was useful with a click!
Nope, not helpful...Yep, more useful than not! (No Ratings Yet)
Loading...