Upload only one file

master
Dan Howe 5 years ago
parent 4ddbbc0642
commit b6fa9b35c2

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

Loading…
Cancel
Save