How to use the eel.btl.static_file function in Eel

To help you get started, we’ve selected a few Eel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shadowmoose / RedditDownloader / redditdownloader / interfaces / eelwrapper.py View on Github external
def _downloaded_files():
	""" Allows the UI to request files RMD has scraped.
		In format: "./file?id=file_token"
	"""
	token = eel.btl.request.query.id
	file_obj = _session.query(sql.File).filter(sql.File.id == token).first()
	file_path = file_obj.path
	response = eel.btl.static_file(file_path, root=os.path.abspath(settings.get("output.base_dir")))
	response.set_header("Cache-Control", "public, max-age=0")
	return response