refactored delete log file

fix error in delete upload
added delete_logfile()