# Fetch image from wix url

**URL:** <https://forum.wixstudio.com/t/fetch-image-from-wix-url/33294>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [October 17, 2022, 2:36pm UTC](https://forum.wixstudio.com/t/fetch-image-from-wix-url/33294 "2022-10-17T14:36:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathieu\_stjean](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mathieu\_stjean](https://forum.wixstudio.com/u/mathieu_stjean)\
**Post date:** [October 17, 2022, 2:36pm UTC](https://forum.wixstudio.com/t/fetch-image-from-wix-url/33294/1 "2022-10-17T14:36:25Z")

</div>

Hi, I’m trying to fetch an image from a converted wix url (wix:data → https://…). Unfortunately, I can’t seem to find a way to fetch to buffer. I need to resize it before sending it to an api (and by default, the images are too large).

I tried to fetch but got the following:  
import fetch from ‘node-fetch’ ;  
let memoryImage = **await** fetch ( url ). then (( response ) =\> {  
**return** response  
})

 ![](https://us1.discourse-cdn.com/wix/original/3X/5/a/5a12fabc0f329596ce32ea9c96ecabc32cc56c93.png)

I also tried with the Request library (very old and outdated), but got some generic “Error: error”

I saw that there is a “Wix-Fetch”, but I can’t seem to access the data.

Any help would be appreciated,  
Thank you

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [October 17, 2022, 2:40pm UTC](https://forum.wixstudio.com/t/fetch-image-from-wix-url/33294/2 "2022-10-17T14:40:13Z")

</div>

[https://www.wix.com/velo/reference/wix-fetch/fetch](https://www.wix.com/velo/reference/wix-fetch/fetch)

---

<div class="post-metadata">

**Author:** ![mathieu\_stjean](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mathieu\_stjean](https://forum.wixstudio.com/u/mathieu_stjean)\
**Post date:** [October 17, 2022, 3:35pm UTC](https://forum.wixstudio.com/t/fetch-image-from-wix-url/33294/3 "2022-10-17T15:35:30Z")

</div>

As mentioned above, I’ve tried with Wix-Fetch, but it won’t give me the buffer, like the standard Fetch library would:

let body = **await** fetch ( url , { “method” : “get” })  
. then (( httpResponse ) =\> {  
if ( httpResponse.ok ) {  
**return** httpResponse  
} **else** {  
**return** Promise . reject ( “Fetch did not succeed” );  
}  
})  
. catch ( err =\> console . log ( ‘fetch’ , err ));

The response of this gives:

![](https://us1.discourse-cdn.com/wix/original/3X/2/7/274039b744614de42e170bb3b70af6966c627546.png)

Normally, with Fetch, you’d use arrayBuffer(), but it doesn’t exist on this one. I also tried to use the .text() or json(), no data there.

---

<div class="post-metadata">

**Author:** ![user1638](https://avatars.discourse-cdn.com/v4/letter/u/ce7236/32.png) [@user1638](https://forum.wixstudio.com/u/user1638)\
**Post date:** [March 1, 2024, 6:03pm UTC](https://forum.wixstudio.com/t/fetch-image-from-wix-url/33294/4 "2024-03-01T18:03:54Z")

</div>

I am having the same problem, the Data that i can store in the variables from a https request is on json() or string() there is no byte type that i can use for example for fetching a img or a doc file. There is someway to do this inside Wix i am thinking of using third party server to do it instead.
