Here is my demo of file upload with a number of changes.

I did my patches against the latest (v1.167) version of phpMyEdit class from CVS repository.
My version also includes the following patches:
 - file upload
 - fixed one too many </tr> that gave me trouble when trying to include phpME stuff in other
   tables within application
 - sub-forms patch (check the sub forms discussion on this forum) 

Changes to file upload:
 - I noticed that editing a record with attachment caused loosing attachment information
   This has been fixed
 - A common problem in office environment.  A file is scanned and attached to contact record.
   A name of the scan file is temp.gif. Then another file is scanned, saved with the same
   (temp.gif) name and attached to another record. 
   The result? The original attachment to first record is lost.
   This patch fixes it by giving the uploaded file a prefix with ID of the record that
   it was attached to.  This means that now the file upload trigger must be executed as
   a post insert trigger (when we know the record id of the inserted record).
-  File upload trigger was changed to generate unique upload files
-  Javascript changed a bit too :)
-  When in edit mode, the name of the  attachment file is now displayed next to
   upload field. 

File upload trigger can be found in triggers dir, javascript in scripts dir, style sheet in 
css dir.  

To get it working:
  - create database and run mm_demo.sql in mysql
  - change include/config.inc to reflect your databas settings.
  - open tbctattachments.php in browser

Diff file is included, so are the original and patched versions of v1.167 class file 
from CSV repository.

BTW,
I am  using Multi Form Generator (MFG)for phpMyEdit from 
http://hockinson.com/php-form-generator/index.php
to generate forms, it works fine with patched class file.

Cheers
M
