Dear all,

Is it possible to offer a file for downloading in web2py?

        theFile = tempfile.NamedTemporaryFile()
        with open(theFile.name, "wb") as myFile:
            myFile.write("something")
        return response.download(request, theFile)

For instance, when a user goes to "mysite.com/myapp/default/download/text", 
I return a file with "text" written in it.
I would like to use a tempfile for that.

There is no "request" here, so "return response.download(request, theFile)" 
does not work.
Any suggestion?

Reply via email to