rvmsudo passenger start -p 80 --user=user.name
a script with the following code only outputs part of the csv file.
I'm using rails 3.1.1, and have a controller with the following code-
filename = "generated_#{Time.now.localtime.strftime('%Y-%m-%d')}].csv"
csv_file = MyDataModel.export # returns full csv file as string
@output = csv_file.length
# Send to browser
response.headers['Content-Length'] = csv_file.length.to_s
#=begin
send_data 'test'.to_s,
type: 'text/csv', encoding: 'utf8',
disposition: "attachment",
filename: filename,
length: csv_file.length
My guess is that send_data is not setting a content-length which is
why the browser cuts the download immediately. The file should be
about 600kb in size, but truncates transmission at 16kb everytime.
Does anyone know hoe to fix this problem? I want a fill download not a
partial one which is what it's giving me.
If I run the same app using webrick, everything works like a charm.
Thanks in advance