Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

Using dash_uploader to upload to S3 bucket

This is the sample block of code that I have revised to point at my bucket URL instead of a directory on my local machine. I have changed my actual bucket name to mybucketname.

When running this, there are no errors - it just sits idle without the upload bar increasing…

Is what I am attempting even possible?

Thank you

from pathlib import Path
import uuid
import dash_uploader as du
import dash
from dash import html
from dash.dependencies import Input, Output, State

app = dash.Dash(__name__)

bucket = 'https://mybucketname.s3.us-east-2.amazonaws.com/upload'
UPLOAD_FOLDER_ROOT = bucket
# UPLOAD_FOLDER_ROOT = r"C:\tmp\Uploads"
du.configure_upload(app, UPLOAD_FOLDER_ROOT)

def get_upload_component(id):
    return du.Upload(
        id=id,
        max_file_size=1800,  # 1800 Mb
        filetypes=['csv', 'zip'],
        upload_id=uuid.uuid1(),  # Unique session id
    )

def get_app_layout():
    return html.Div(
        [
            html.H1('Demo'),
            html.Div(
                [
                    get_upload_component(id='dash-uploader'),
                    html.Div(id='callback-output'),
                ],

                style={  # wrapper div style
                    'textAlign': 'center',
                    'width': '600px',
                    'padding': '10px',
                    'display': 'inline-block'
                }),
        ],
        style={
            'textAlign': 'center',
        },
    )

# get_app_layout is a function
# This way we can use unique session id's as upload_id's
app.layout = get_app_layout
@du.callback(
    output=Output('callback-output', 'children'),
    id='dash-uploader',

)
def get_a_list(filenames):
    return html.Ul([html.Li(filenames)])
if __name__ == '__main__':
    app.run_server(debug=True, port=8090)