What I’m trying to do:
Allow users to see a file:
https://client.planplate.com/_/api/menu/a022c1f9-7cc3-44ce-9523-0952a8b6f8be/4d91c3b5-8e57-4e7c-9c4f-5c49590b6b22
What I’ve tried and what’s not working:
Placed that link on dilettante.lv, when clicked it opens like this:
Code Sample:
@anvil.server.http_endpoint("/menu/:resto_id/:menu_id", enable_cors=True, cross_site_session=True)
def serve_menu(resto_id, menu_id, **p):
menu_in_db = app_tables.menu_files.get(restaurant=resto_id, menu_id=menu_id)
if menu_in_db is not None and menu_in_db['menu_file'] is not None:
media = menu_in_db['menu_file']
return anvil.server.HttpResponse(status=200, body=media, headers=None)
# return media #also has the same error
else:
return anvil.server.HttpResponse(body="Media not found", status=404)
If it helps on the originator site I get this:
What is the “Internal server error serving Lazy Media: 2d9446ec3d44” ?
How do I fix it?