Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,14 +36,15 @@ def main():
|
|
36 |
form = st.form(key='zip_form')
|
37 |
zip_file_name = form.text_input("Zip file name",
|
38 |
value=f"{os.path.splitext(files[0].name)[0]}.zip")
|
|
|
39 |
submit_button = form.form_submit_button("Create Zip File")
|
40 |
|
41 |
if submit_button:
|
42 |
# zipファイルを作成する
|
43 |
-
|
44 |
zip_files(src=[file.name for file in files],
|
45 |
dst=zip_file_name,
|
46 |
-
password=
|
47 |
# ダウンロードリンクとパスワードの表示
|
48 |
st.markdown(get_binary_file_downloader_html(zip_file_name,
|
49 |
text=f"Download {zip_file_name}"),
|
|
|
36 |
form = st.form(key='zip_form')
|
37 |
zip_file_name = form.text_input("Zip file name",
|
38 |
value=f"{os.path.splitext(files[0].name)[0]}.zip")
|
39 |
+
password = form.text_input("passward", value="<random>")
|
40 |
submit_button = form.form_submit_button("Create Zip File")
|
41 |
|
42 |
if submit_button:
|
43 |
# zipファイルを作成する
|
44 |
+
_password = generate_password() if password == "<random>" else password
|
45 |
zip_files(src=[file.name for file in files],
|
46 |
dst=zip_file_name,
|
47 |
+
password=_password)
|
48 |
# ダウンロードリンクとパスワードの表示
|
49 |
st.markdown(get_binary_file_downloader_html(zip_file_name,
|
50 |
text=f"Download {zip_file_name}"),
|