if you're going to use mysql as your database, have a blob field to store your file in the table, instead of "copy"ing uploaded file, fopen it and "insert" the content of the file into the db..
you better keep
file name
content type of the file [you can get it from HTTP vars]
too, while keeping the file content..