ihp icon indicating copy to clipboard operation
ihp copied to clipboard

`FileStorage` functions should work well with each other.

Open s0kil opened this issue 2 years ago • 2 comments

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.

s0kil avatar Apr 10 '22 21:04 s0kil

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.

s0kil avatar Apr 10 '22 21:04 s0kil

Saving the path is not a good idea because the bucket name could change, but the files are not available in the new bucket.

s0kil avatar Apr 26 '22 13:04 s0kil