Creating a new block for an Auction block

Permalink
I am developing a new block to allow auction photos to be displayed.

the block at the edit screen will have various fields which are easy to do but I cannot find how I select a file directory store this in the block table and then read each photo out of that directory based on the filename.

My code will get the lot number from a database table and this will five me the file name of the photo. eg lot 100 for auction will be 23_0100. 23 being the auction number 0100 being the lot number.

Any sample of code to get the retrieve the photo based on name would help.

Thanks