I’m trying to find the file location in a string after using the file input widget but I’m really struggling to get it to work. Ultimately what I want to do is find the file location, then find two other files in other sub directories to open. If I have the string of the main file, it’s pretty easy to pick up the other files because they have a common naming convention.
A simplified version of the callback I’m using is:
def upload_ppd_data(attr, old, new):
decoded = b64decode(new)
ppd_file = io.BytesIO(decoded)
ppd_df = pd.read_excel(ppd_file, header=9)
I tried to decode decoded to a string using decoded.decode(‘utf-8’) but that didn’t seem to work. I really don’t understand what I’m doing here so I’m hoping it’s a simple problem that I’m just not figuring out from other threads.