Upload only one file

master
Dan Howe 5 years ago
parent 4ddbbc0642
commit b6fa9b35c2

@ -35,8 +35,8 @@ app.layout = html.Div([
'textAlign': 'center',
'margin': '10px'
},
# Allow multiple files to be uploaded
multiple=True),
# Only upload one file
multiple=False),
html.Div(id='output-data-upload'),
])
@ -152,20 +152,16 @@ def parse_contents(contents, filename, date):
return elements
@app.callback([Output('output-data-upload', 'children')], [
@app.callback(Output('output-data-upload', 'children'), [
Input('upload-data', 'contents'),
Input('upload-data', 'filename'),
Input('upload-data', 'last_modified'),
])
def update_output(contents, names, dates):
def update_output(contents, name, date):
if contents is not None:
children = [
parse_contents(c, n, d) for c, n, d in zip(contents, names, dates)
]
return children
return parse_contents(contents, name, date)
else:
return [html.Div([])]
return html.Div([])
def main():

Loading…
Cancel
Save