Just to get a handle on what you are trying to do, You are uploading an image to the server, or the database? Is the file upload achieved through a HTML form?