base_path = Rails.root.join('storage', 'exports').realpath
requested = base_path.join(params[:filename].to_s).cleanpath
unless requested.to_s.start_with?(base_path.to_s) && requested.file?
raise ActionController::RoutingError, 'Not Found'
end
use std::path::{Component, Path, PathBuf};
#[derive(Debug)]
pub enum ResolveError {
Traversal,
NotFound,