MCPcopy Create free account
hub / github.com/devforth/painterro / base64_saver

Function base64_saver

example/server.py:43–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41
42@app.route("/save-as-base64/", methods=['POST'])
43def base64_saver():
44 filename = '{:10d}.png'.format(int(time())) # generate some filename
45 filepath = os.path.join(get_tmp_dir(), filename)
46 with open(filepath, "wb") as fh:
47 base64_data = request.json['image'].replace('data:image/png;base64,', '')
48 fh.write(base64.b64decode(base64_data))
49
50 return jsonify({})
51
52
53@app.route("/save-as-binary/", methods=['POST'])

Callers

nothing calls this directly

Calls 1

get_tmp_dirFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…