0

I have a custom option of type file where I am allowing user to upload photo while adding a product to cart.

I am using the REST api to get the cart items. Below is the response for the same.

[
    {
        "item_id": 525,
        "sku": "782-169",
        "qty": 1,
        "name": "simple product 1",
        "price": 0,
        "product_type": "simple",
        "quote_id": "538",
        "product_option": {
            "extension_attributes": {
                "custom_options": [
                    {
                        "option_id": "3",
                        "option_value": "image/png,photosample.png,/var/www/html/magento2/pub/media/custom_options/quote/p/h/photosample.png,custom_options/quote/p/h/photosample.png,custom_options/quote/p/h/photosample.png,457,40,40,700e78d4f014ef0da997"
                    }
                ]
            }
        }
    }
]

URL I am using to fetch the image is : http://local.magento2.com/media/custom_options/quote/p/h/photosample.png

It gives me 404 error. I also tried below urls http://local.magento2.com/media/customoptions/quote/p/h/photosample.png http://local.magento2.com/media/custom_options/quote/p/h/700e78d4f014ef0da997

But same error I am getting. Can anyone please help me here?

1 Answer 1

0

I have changed the pub/media/custom_options/.htaccess and commented the two lines. It is working for me now. If anyone having better solutions please let me know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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