ihp
ihp copied to clipboard
`FileStorage` functions should work well with each other.
Suppose you have a customer
with a profile_url
. In the create or update controller, you call |> uploadToStorage #profileUrl
, and later you need to retrieve the logoUrl
and render it. When your S3 storage is public, no problem, render the URL stored in the database. However, when you have a private S3 storage, it's not clear how to render the image. The profile_url
is a full URL, and we do not have functions to handle that. createTemporaryDownloadUrlFromPath
, createTemporaryDownloadUrlFromPathWithExpiredAt
cannot be used here.
Right now I see two solutions, we can introduce createTemporaryDownloadUrlFromUrl
and createTemporaryDownloadUrlFromUrlWithExpiredAt
.
Or uploadToStorage
function will save the path the object is located at, and not the full URL.
Saving the path is not a good idea because the bucket name could change, but the files are not available in the new bucket.