def my_download():

    import os
    import contenttype as c

    response.headers['Content-Type'] = c.contenttype("example.mp3")

    path=os.getcwd()+"/"+'albums'+"/"+request.vars.album
+"/"+request.vars.filename
    return response.stream(open(path,'rb'),chunk_size=4096)


On Aug 11, 8:19 pm, Anthony <[email protected]> wrote:
> What does your download function look like?
>
>
>
> On Thursday, August 11, 2011 2:48:18 PM UTC-4, peter wrote:
> > I am trying to create a download routine similar to the one in
> > default.py. However I wish to download mp3 files that have not been
> > previously uploaded, so I want to just download files I specify by
> > location. I was able to get this working. However the file that is
> > shown to the user in the 'Do you want to open or save box' comes from
> > the first argument of the /default/download call. This is too
> > restrictive, as it objects eg to a file called 'harold's bossa.mp3',
> > because the apostrophe creates problems. The apostrophe would not
> > cause prolems if the name were passed in the 'vars'. However I have
> > combed the gluon files and cannot find where the magic happens that
> > copies the first argument across to the streaming routines. I have
> > tried 'tricking' the stream routines by altering request and response,
> > but to no avail.
>
> > Can any tell me where the arg gets copied to the stream routines so
> > that I can modify it (or rather modify a clone)
>
> > Thanks
>
> > Peter- Hide quoted text -
>
> - Show quoted text -

Reply via email to