dankmango
dankmango8mo ago

Download URL not working

I'm using WeWeb to display images that were uploaded to Buildship's internal Bucket. This works fine. But when I add an action in Weweb for users to download the images I get an error when it is clicked saying "failed to fetch". Any idea why this is and how I can resolve this?
Solution:
Yes, you can refer to this video - https://www.youtube.com/watch?v=7yJ6ddq6_Ls.
NoCodeDevs
YouTube
BuildShip + WeWeb = Build ANY Powerful Web App
In this tutorial, we'll show you how you can use BuildShip and WeWeb to build any powerful web app. We'll guide you through the process using the low-code, AI-powered tool BuildShip for the backend and WeWeb for the front end. We will create an app that lets you enter a URL and get back a screenshot of the website. Choose from over 50 pre-built...
Jump to solution
16 Replies
Gaurav Chadha
Gaurav Chadha8mo ago
Hi @dankmango, are the returned image a public url?
dankmango
dankmangoOP8mo ago
@Gaurav Chadha yes because it is also displaying correctly in weweb, it's only the download that doesn't work. Keeps saying "failed to fetch". From my research it seems that this could be a CORS issue? I also have signedUrl images in Supabase and those can be downloaded without any issue. It's only the ones stores in BuildShip bucket that is not working.
Gaurav Chadha
Gaurav Chadha8mo ago
Okay, you can enabled the Proxy request to bypass CORS issues in WEWeb, you can also double check and test the BuildShip API on Postman or any testing tool of your coice to confirm if you are able to download it outside of BuildShip too. https://docs.weweb.io/plugins/data-sources/rest-api.html#resolving-cors-issues. I checked by testing it on WeWeb API Request.
No description
dankmango
dankmangoOP8mo ago
Thanks, but I still don't understand how to download the image? Are you saying I should do a REST API call from Weweb to BuildShip? And then what would the flow look like?
Solution
Gaurav Chadha
Gaurav Chadha8mo ago
Yes, you can refer to this video - https://www.youtube.com/watch?v=7yJ6ddq6_Ls.
NoCodeDevs
YouTube
BuildShip + WeWeb = Build ANY Powerful Web App
In this tutorial, we'll show you how you can use BuildShip and WeWeb to build any powerful web app. We'll guide you through the process using the low-code, AI-powered tool BuildShip for the backend and WeWeb for the front end. We will create an app that lets you enter a URL and get back a screenshot of the website. Choose from over 50 pre-built...
dankmango
dankmangoOP8mo ago
@Gaurav Chadha this doesn't work. It just retrieves a new url but when I try to download that new public url I still get the same failed to fetch message.
Gaurav Chadha
Gaurav Chadha8mo ago
Could you please share some screenshots on how you are testing on WeWeb, did you checked in with WeWeb too? Does testing the BuildShip API on Postman or any other API Testing tool give the URL from which you are able to download?
dankmango
dankmangoOP8mo ago
@Gaurav Chadha see screenshots. I get a new url from buildship which I try to download but it doesn't work. I have posted on weweb also but haven't received anything back from them. Like I said, the signedURL's from Supabase Storage I can download without problems but the ones from the BuildShip bucket gives the "Failed to fetch" error as per the screenshot. I am at a loss and have been trying for 2 days to get this working.
No description
No description
dankmango
dankmangoOP8mo ago
Just to explain what I am trying to do. I want to show the public images that are stores in the BuildShip bucket (this works) and then have a button that the user can click to download the image(s) to their local device -> it is this part that doesn't work.
Gaurav Chadha
Gaurav Chadha8mo ago
Use the Generate Public Download URL node and pass the file path of the file which is is the BuildShip. It gives a publically accessible url which you can use, eg: https://storage.googleapis.com/buildship-6dk2jv-asia-southeast1/fruit.png
No description
dankmango
dankmangoOP8mo ago
@Gaurav Chadha it returns the exact same file path which is already public and I get the same result.
Gaurav Chadha
Gaurav Chadha8mo ago
can you share an example link?
Gaurav Chadha
Gaurav Chadha8mo ago
The download URL and generate public url node works differently.
dankmango
dankmangoOP8mo ago
from what I can see is that this is a CORS issue. you will need to enable us to create signedURL's or you will need to add weweb to the cors config file to enable downloads from there. alternatively I will need to upload my files to Supabase Storage rather (but there is no node for this so I will need to custom develop it). @Gaurav Chadha just tagging you
Gaurav Chadha
Gaurav Chadha8mo ago
I'll create a draft workflow and will test it on Weweb and will update you. Thank you for your patience.