Spin Hall and Edelstein effects in metallic films: From two to three dimensions