2

I'm using the Magento 2 rest API to read out the orders in to our system. If an order line product have a custom file option we want to download this file.

From the order items we get the following custom option result:

"option_value": "image/png,abu.png,custom_options/quote/a/b/2f25a9e4bb5afd53ad4e097c024289b6.png,custom_options/order/a/b/2f25a9e4bb5afd53ad4e097c024289b6.png,/var/www/html/magento2/pub/media/custom_options/quote/a/b/2f25a9e4bb5afd53ad4e097c024289b6.png,269733,651,718,2f25a9e4bb5afd53ad4e"

How can we download this file. The Magento backend uses the UUID and also a column id?

Question: How can you download a file uploaded by the user from the rest API?

Khoa Truong
32.5k11 gold badges91 silver badges159 bronze badges
asked Apr 15, 2017 at 14:58

1 Answer 1

0

You can get the information of the file exploding the "option_value", first element: File extension second element: File Name third: Download link (prepend: base_url + "media/")

eg: File extension: png File name: abu.png Download link: /media/custom_options/quote/a/b/2f25a9e4bb5afd53ad4e097c024289b6.png

answered Sep 20, 2019 at 19:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.