Large Image upload via REST API

HardikM
New Member
2 0 0

I'm using Create a new product image with included image data as attachment from https://shopify.dev/docs/admin-api/rest/reference/products/product-image#create-2021-04

small images are not an issue, but uploading large images is impossible I tried to follow File upload as JSON base64 encoded - YouTube, but even that didn't help much as I'm using windows 10 and windows has a variable size limit which is very less then the maximum size of the base64 encoded data,

kindly help

Thank you in advance

0 Likes
CalD
Shopify Staff
Shopify Staff
128 15 18

Hey @HardikM,

Can you use the "src" field in the payload to specify the image URL? 

Also take a look at this tutorial to upload local images for use in updating product media: https://shopify.dev/tutorials/manage-product-media-with-admin-api

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
HardikM
New Member
2 0 0

Thank you for reverting

the images are on the local system and need to be uploaded and hence "src" will not work, they are not on any server that shopify can copy from, hence have taken the base64 approach, the issue is the file size goes on the higher side, and then it becomes an issue, small images are not an issue, but the larger ones take up a lot of resource

I sincerely think shopify should give an API to upload via form-data that would be a great help, but that's my opinion.

I'm stuck at this point, any help would be great

0 Likes