Hi everyone,
Just one question, has anybody tried to use resumable upload component on multipage app?
I’m running into a problem when trying to do this, since I get blank page, no error on server.
below is the structure of the app I’ve tried - when I add in app1.py just some static content like html.H3(‘App 1’) app works fine and displays it on a screen but when I run it as presented below it shows only blank screen. I guess the problem is with dash_resumable_upload.decorate_server(app.server, “uploads”) component, maybe I’m placing it at the wrong place, or it requires another step or workaround? Any idea will be appreciated.
app.py
import dash
app = dash.Dash()
app.config.suppress_callback_exceptions = True
app1.py:
import dash_resumable_upload
import dash_html_components as html
layout = html.Div([
dash_resumable_upload.Upload(
id=‘upload’,
maxFiles=1,
maxFileSize=102410241000, # 100 MB
service="/upload_resumable",
textLabel=“Drag and Drop Here to upload!”,
)
])
index.py
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from app import app
from apps import app1
import dash_resumable_upload
dash_resumable_upload.decorate_server(app.server, “uploads”)
app.layout = html.Div([
dcc.Location(id=‘url’, refresh=False),
html.Div(id=‘page-content’)
])
@app.callback(Output(‘page-content’, ‘children’),
[Input(‘url’, ‘pathname’)])
def display_page(pathname):
if pathname == ‘/’:
return app1.layout
else:
return ‘404’
if name == ‘main’:
app.run_server(debug=True)