Adding authentication checks on upload and down