Custom fields on File Attachment Window

Hi,
I want to add some custom fields to the file attachment to further classify that attachment. Adding new fields is easy but which files/code need to be amended so that the custom fields show up when a file is uploaded and can be filled at that very moment instead of finding the file later and adding details to it? Can anybody help?