method

download

rails latest stable - Class: ActiveStorage::Service::DiskService
download(key, &block)
public

No documentation available.

# File activestorage/lib/active_storage/service/disk_service.rb, line 28
    def download(key, &block)
      if block_given?
        instrument :streaming_download, key: key do
          stream key, &block
        end
      else
        instrument :download, key: key do
          File.binread path_for(key)
        rescue Errno::ENOENT
          raise ActiveStorage::FileNotFoundError
        end
      end
    end