Does anyone know if there a way to access the root URL of a private file with the AWS access keys and use this in a workflow, dynamically?
An example of which I have pasted below with some xxx for privacy.
Does anyone know if there a way to access the root URL of a private file with the AWS access keys and use this in a workflow, dynamically?
An example of which I have pasted below with some xxx for privacy.
Hello @klobassimon
Did you find a way ?
Yes I have worked out how to work with private files on bubble. You need to
Reupload as public (temp file), use the file and then delete the temp file
You can access a private file using api key too. However, this url could have a redirect to the AWS file and the API server you are trying to connect may have an issue to follow redirect to access the file.
@klobassimon @akoziol @Jici - I’ve just released a plugin which hopefully helps with this use case.
Still in Beta, so any and all feedback is welcome!
Is the jist of this, that Bubble replies with a signed URL if you go to the file URL with the bearer token in the headers?
If so I know it would be less capable like single URLs only, but could API Connector be used instead? (faster with no cold starts, lower WU usage)
Cool - I used the Native API connector to have better control over functionality.
Yup that’s the jist @tylerboodman!
Unfortunately if you GET a file with the API connector it doesn’t return the URL, but the file itself so you end up saving this file to the DB (as public).
If you know of another method to GET the signed url - let me know!
Hopefully bubble will just make it a native action.
On mobile but will share later.
Just checked the @DjackLowCode and this is exactly what need to be done.
The issue with API Connector is that we don’t have an option to no follow redirect (you can upvote this request I made a long time ago: Do not Follow redirect option in API Connector | Bubble)
So the plugin do a request and check if a 302 redirect happen. If yes, return the location header that is the final target after the redirect. @DjackLowCode I suggest you to try to use a HEAD request instead of get request. Will be faster and probably avoid issue with larget file.
Thanks, I tried also to use a plugin with axios but could get back the location.
With your code is working like a charm
Nice thanks @jici - I’ve now tested with HEAD and it’s more performant. I’ll test and push to the plugin soon.