Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support uploading media as binary #39

Closed
mschop opened this issue Aug 8, 2022 · 1 comment
Closed

Support uploading media as binary #39

mschop opened this issue Aug 8, 2022 · 1 comment

Comments

@mschop
Copy link

mschop commented Aug 8, 2022

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

@vienthuong
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants