I have tried to upload images for the different variations as like below with generating media_id in laravel.
str_replace('-', '', Str::uuid()->toString());
The above code is creating a random string and with the help of that some of the images are uploading but some are not.
$urlArr = array('url' => $url);
$parts = pathinfo($url);
$params = array('extension' => $parts['extension'],'fileName' => $parts['filename'] . '__' . md5(time()),);
$uploadImage = $shopware6HelperObj->post('_action/media/' . $mediaId . '/upload', $urlArr, $params, $accessToken);
Above is the process of upload variation images but somehow some of the products of variations are uploading while some are not.
Can you please suggest where is the issue and lake in the code?