Thanks MCM this method still works nearly 3 years later!
A question though:
when the csv file is downloaded it has the name 'unknown' with no .csv. Do 
you know how I can change that filename to something like 'data.csv' ?
thanks in advance,
Ben

On Friday, November 1, 2013 at 3:36:00 PM UTC-7, mcm wrote:
>
> To avoid redirect and use ajax see this thread:
>
> https://groups.google.com/d/msg/web2py/HQU5kD0tGag/LGtjlikzWdsJ
>
> mind that there is a penalty due to base64 encoding, that implies that the 
> benefit depends on how large the data to be trasmitted is. 
>
>
> 2013/11/1 Niphlod <nip...@gmail.com <javascript:>>
>
>> yep. 
>> check response.stream
>>
>>
>> http://web2py.com/books/default/chapter/29/04/the-core?search=response.stream
>>
>>
>> On Friday, November 1, 2013 8:24:11 PM UTC+1, San L wrote:
>>>
>>> We would like to allow use user to download a csv file when clicking a 
>>> button on a page (not redirect or pop up a new window). Is this doable in 
>>> web2py?
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to