{{=IMG(src=URL(r=request,c='default',f='mydownload',args=
['folder1','folder2',user_id,filename])}}

so then

#default controller
def mydownload():
  filename=os.path.join(request.folder,'uploads',request.args
(0),request.args(1),request.args(2))
  return response.stream(open(filename,'rb'))

On Jan 11, 11:52 pm, weheh <[email protected]> wrote:
> I think I understand what you're trying to do but it's not working for
> me. Since I've already accessed the db, there's no point in
> duplicating the access in download in order to get the user_id. Why
> can't I just pass the user_id to downloads as an arg?
>
> #view
> {{=IMG(src=URL(r=request,c='default',f='mydownload',args=
> ['folder1','folder2',user_id,filename])}}
>
> so then
>
> #default controller
> def mydownload():
>   db.table.myfile.uploadfolder=os.path.join
> (request.folder,'uploads',request.args(0),request.args(1),request.args
> (2))
>   return response.download(request,db)
>
> Unfortunately, this doesn't work for me, either. No tickets are thrown
> in either case. And now, I don't even see any of the images associated
> with the currently logged in user. Hmmmm......
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to