Closed vipafattal closed 2 years ago
I'm also with the same issue. I'm trying to get the url to use caching packages such as CachedNetworkImage. In case it is not possible, has anyone found any caching solution for image files? thank you
👀 Following - will need the functionality as well!
I managed to create getPublicUrl
function and it's simple.
Looking for the javascript implement for storage client:
getPublicUrl(params: StorageGetUrlParams): string {
const { fileId } = params
return `${this.url}/files/${fileId}`
}
As you can see from the code above, it's as simple as
final fileUrl = "{STORAGE_URL}/files/{FILE_ID}";
Please note to be able to access the file publicly without auth you need to have a public role with select permission. For me, I created a public role that allows selection only on images mime_type
just like below
How to get a public URL if we want to download a file manually without using the functions
storage.downloadFile
orstorage.downloadImage
, Something like getPublicUrl in the storage.At the same time, I tried to use the
getPresignedUrl
from storage with Nhost running from CLI but I'm keep getting an errorERR_CONNECTION_REFUSED
Thank You!