instance method
download_chunk
Ruby on Rails 6.1.7.10
Since v5.2.8.1Signature
download_chunk(key, range)
No documentation comment.
Parameters
-
keyreq -
rangereq
Source
# File activestorage/lib/active_storage/service/disk_service.rb, line 40
def download_chunk(key, range)
instrument :download_chunk, key: key, range: range do
File.open(path_for(key), "rb") do |file|
file.seek range.begin
file.read range.size
end
rescue Errno::ENOENT
raise ActiveStorage::FileNotFoundError
end
end
Defined in activestorage/lib/active_storage/service/disk_service.rb line 40
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Service::DiskService