Try using @tempfile.size for TempObject#size