test2023h5's picture
Upload 44 files
7798609 verified
raw
history blame contribute delete
880 Bytes
'''
title: Upload
'''
import streamsync as ss
import pandas as pd
ss.md("## ss.upload File Upload")
ss.space()
ss.md("#### πŸ”… Example - Upload Image")
ss.space()
def onsucess(event):
filename = event.value
path = f'{ss.baseinfo["package_path"]}/uploads/{filename}'
ss.write("debug", path)
myimage.image = path
ss.upload("Upload Image ...", accept="image/png, image/jpeg, image/bmp", icon="mdi-camera", onsucess = onsucess)
myimage = ss.image(width=300)
ss.space()
ss.write("---")
ss.write("#### πŸ”Ž Code")
ss.md('''
```python
import simplestart as ss
def onsucess(event):
filename = event.value
path = f'{ss.baseinfo["package_path"]}/uploads/{filename}'
myimage.image = path
ss.upload(label = "Upload Image ...", accept="image/png, image/jpeg, image/bmp", icon="mdi-camera", onsucess = onsucess)
myimage = ss.image()
''')