complete delete uploadfile function