We need to see more code -- maybe your model and the code that generates 
the value of download_path. response.download() will return a 404 if the 
filename is not of the right format, it can't find the table/field, or it 
can't retrieve the file.

Anthony

On Tuesday, October 15, 2013 10:06:45 PM UTC-4, Jordan Ladora wrote:
>
> Ha! Thanks for that.. I upgraded to 2.7.4. but get 404 not found when I 
> use Anthony's code..
>
> in the view-
>
>     <td>{{=A('Download', _href=URL('default', 'download', 
> args=download_path))}}</td>   
>     <td>{{=A('Download w title', _href=URL('default', 'download', 
> args=[download_path, 'new_title']))}}</td>   
>
>
> in default.py-
>
> @auth.requires_login()
> def download():
>     """
>     allows downloading of uploaded files
>     http://..../[app]/default/download/[filename]
>     """
> ##    response.download(self, request, db, chunk_size=DEFAULT_CHUNK_SIZE, 
> attachment=True, download_filename=None):
>     return response.download(request, db, 
> download_filename=request.args(1))
>
>
> ...hopefully there is something else silly that i am doing wrong here...?
>
> Thanks,
> jl
>
>
> On Tuesday, October 15, 2013 3:01:49 PM UTC-7, Niphlod wrote:
>>
>> You're using an old version of web2py :D
>>
>> On Tuesday, October 15, 2013 11:40:55 PM UTC+2, Jordan Ladora wrote:
>>>
>>> Err.. I get an unknown parameter error for the 'download_filename' .. 
>>> looking into globals.py I see 
>>>
>>>     def download(self, request, db, chunk_size=DEFAULT_CHUNK_SIZE, 
>>> attachment=True):
>>>
>>> so I'm not sure about where this parameter goes(?)
>>>
>>> Thanks,
>>> -j
>>>
>>>>
>>>>

-- 
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/groups/opt_out.

Reply via email to