Added logic to upload files and save them