[BUGFIX] Upload to the wrong storage

In some cases, the file is uploaded to the wrong storage
Releases: 3.0, 2.0
Resolves: #55858

Change-Id: I95507b12edc4694c873afcfd1c9324ffbfa43152