Continuing this old thread:
http://groups.google.com/group/web2py/browse_thread/thread/59b66b3a242d89f1/7183f04206074ebf?lnk=gst&q=download_audio#7183f04206074ebf
Anybody know why the following code isn't working? I'm trying to
implement almost exactly what Massimo suggested in the previous
thread. Here's my code:
#controller "audio.py"
def download_audio():
f=os.path.join(request.folder,'private',request.args(0))
return response.stream(open(f,'rb'))
#model "show_audio.py"
def show_audio():
filename='audio/aab/hello_world.mp3' # this is a hardcoded value
for this test case
url=URL(r=request,c='audio',f='download_audio',args=filename)
return EMBED(_src=url,_autoplay='true')
#view "index.html"
{{=show_audio()}}