vienthuong/shopware-php-sdk

Support uploading media as binary

mschop opened this issue · 1 comments

Hi,

currently it is not possible to use the AdminActionService for uploading media as binary. Only url based upload is supported.

See: https://shopware.stoplight.io/docs/admin-api/ZG9jOjEyNjI1Mzkw-media-handling#upload-the-resource-directly

Expected available API:

(new AdminActionService($context))->execute('POST', "media/$mediaId/upload", $imageAsBinary);

But only this works:

(new AdminActionService($context))->execute('POST', "media/$mediaId/upload", ['url' => 'https://something/image.jpg']);

Best Regards

I updated it in the lastest version, feel free to reopen ticket if you have any issue
And also I added a new MediaService, now you can use the MediaService instead
#44