got rid of the upload_file function; now saves the attachment id
file upload will check if values already exist now