Added logic of downloading the file and shared file download