The problem with your idea is that to do what you are asking you would need an inside corner piece and an outside corner piece, and, as you know, joints are notorious for developing leaks over time.
Is there a any way you can reverse the slope of that upper gutter and move the downspout out toward the end so water can be directed away from the foundation?
Is there a any way you can reverse the slope of that upper gutter and move the downspout out toward the end so water can be directed away from the foundation?