'Python Bokeh FileInput Widget for DLIS file

I am trying a web app in bokeh where i import a dlis file through the widget fileinput.

I am using the following libraries from dlisio import dlis from pybase64 import b64decode import io

def upload_file_dlis(attr, old, new):
    print('upload_file_dlis')
    decoded = b64decode(new)
    f = io.BytesIO(decoded)

file_input_dlis.on_change('value', upload_file_dlis)

I have the following issue: OSError: '<_io.BytesIO object at 0x000001CE6507CF40>' is not an existing regular file

I guess it is because dlis files are not handled by Io library.

What is the best way to work on this? Do you have any suggestions?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source