I’m writing a controller that retrieves files from Minio/S3 storage and serves them up at paths like /storage//.html. But, no matter what I do, my filenames get truncated to just “html” and don’t work. Here’s my route:
get "/storage*filename", StorageController, :show
And a sample HTML snippet:
Inspecting everything I can shows that the
ig-ag302. is dropped from that URL when it hits the controller.
Any thoughts on how I can get this to work? I think I still want to serve it up from Phoenix because I want to retrieve the
Document model from my database and check whether or not the user has access, but after that I want to stream the remaining URL path from the bucket as if it were a file. Unfortunately, I can’t just accept a format because, for instance, the HTML document generates lots of images, so I need links to those images to work as well.
Thanks for any suggestions.