获取 blob 的永久签名引用并将其转换为到期服务 URL 以供下载。
警告:默认情况下,所有 Active Storage 控制器都是公开可访问的。生成的 URL 难以猜测,但设计为永久的。如果你的文件需要更高的保护级别,请考虑实施 经过身份验证的控制器。
方法
- S
实例公共方法
show() 链接
来源:show | 在 GitHub 上
# File activestorage/app/controllers/active_storage/blobs/redirect_controller.rb, line 12 def show expires_in ActiveStorage.service_urls_expire_in redirect_to @blob.url(disposition: params[:disposition]), allow_other_host: true end