Updated code for uloading files