I used xp_getfiledetails for this in SQL 2000. It's not included in SQL 2005, but a couple of guys have created CLR replacements:
http://blogs.conchango.com/jamiethomson/archive/2006/08/24/4400.aspx
http://www.simple-talk.com/sql/learn-sql-server/building-my-first-sql-server-2005-clr/
I haven't tried either of them yet.
Greg