Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

How to create a a pop-up, modal, or confirm dialog when the file user upload is not a CSV file

$
0
0

@Yuechean wrote:

I want to create a pop-up, modal, or confirm dialog when the file user upload is not a CSV file. Can anyone teach me how to do it?

Below is the code:

def parse_contents(contents, filename):
    content_type, content_string = contents.split(',')
    decoded = base64.b64decode(content_string)
    if 'csv' in filename:
        # Assume that the user uploaded a CSV file
        return pd.read_csv(
            io.StringIO(decoded.decode('utf-8')))

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles