Thanks for your reply Anthony.

That bit is actually working fine. I have put the album folder
deliberately in web2py rather than within the application. This makes
it easier to backup the application or the albums independently.

I will explain my problem with an example.

If I have a url

.../default/my_download/abc.mp3?album=def&filename=ghi.mp3

Then it does correctly download  web2py/albums/def/ghi.mp3

The popup for the user say 'do you want to open or save "abc.mp3"

So the filename for the message comes from the first argument of
my_downloads. As you can see I do not mention args(0) in my routine,
so stream or something below must be accessing args(0). It is this
that I cannot change. I would like abc.mp3 to come from one of the
'vars' rather than the 'args' (because the args are more restrictive
about characters).

Thanks

Peter





On Aug 12, 8:08 pm, Anthony <abasta...@gmail.com> wrote:
> On Friday, August 12, 2011 5:24:24 AM UTC-4, peter wrote:
>
> >     path=os.getcwd()+"/"+'albums'+"/"+request.vars.album
> > +"/"+request.vars.filename
>
> os.getcwd() refers to the web2py folder, not your application folder.
> Assuming the 'albums' folder is in your application folder, you can instead
> use request.folder. Also, you should use os.path.join instead of
> concatenating the path together. Try:
>
> path=os.path.join(request.folder,'albums',request.vars.album,request.vars.f­ilename)
>
> Anthony

Reply via email to