0

I'm working on a project where my product has some datasheets that has to be uploaded to the website. Right now I've created one product attribute named datasheet with attribute type file upload. I'm able to create product using REST API. But the problem is I cannot able to add this files through API as I'm confused how to add this through it.

I know that we can use

"custom_attributes": [ { "attribute_code": "item_ship_day", "value": "Ships in 2 days" }, }

works for normal attributes. But what about file upload

1 Answer 1

1

You can create a custom module to add your attachments to the product's custom_attributes

A detailed answer can be found here

2
  • thank you for your response. But my requirement doesn't comes under this point. Is there any way in magento to upload custom attribute value file as base64encoded value or upload file from path Jun 2, 2021 at 18:32
  • If you want to add a custom attribute and want to get it out via the API, you have no choice but to create a custom_attribute. Also if you want to upload through Magento then you won't get this data via API. Jun 7, 2021 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.