Continuing this old thread:
http://groups.google.com/group/web2py/browse_thread/thread/59b66b3a24...

I'm having trouble getting an embedded mp3 from showing up in my web
page. I'm trying to implement this almost exactly as Massimo suggested
in the above thread. Anybody know why my code below isn't functioning?


#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()}}

Reply via email to