For masking the url we created a seperate routes, controller to fetch the record and generate the url for the download file.
app/controllers/ubiquity/fail_uploads_controller.rb
def download_file
params[:fileset_id]
uuid = params[:uuid]
s3_file_set_url = Ubiquity::ImporterClient.get_s3_url uuid
url = s3_file_set_url.file_url_hash[params[:fileset_id]]
redirect_to url
end
We will be passing the File Set ID
and the Work UUID
to fetch the s3 url from the remote api server. Once we trigger
the api we will get the corresponding s3 url for the specific file and we'll redirect to that particular url to download the file
from s3.