Hii all, I am trying to downaload large file in rails using send_data function ,but getting error :failes to allocate memory and when trying to download in chunks ,getting only chunk size file only ,below is my code ..
File.open(@containerformat.location,"rb"){ |f| @data = f.read(8888)} ext = File.extname(@containerformat.streamName)
if ext == ''
extension = File.extname(@containerformat.location)
send_data(@data,:filename => @containerformat.name+extension,
:disposition => 'attachment')
else
send_data(@data,:filename => @containerformat.streamName,
:disposition => 'attachment')
end
i think am not able to make loop work