Skip to content

Commit 0c2c072

Browse files
🐛
1 parent 48612fb commit 0c2c072

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

blog/2024-5-31.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ description: 记录使用flask搭建个人共享屏幕工具
1515

1616
当然有时候你需要提供必要的文件,比如代码,文档等。所以这个程序还允许你上传与下载文件。上传的文件会保存在当前目录下的`upload`文件夹中,你也可以从`upload`文件夹中下载文件。
1717

18+
例如一个伙伴上传了`test.txt`文件,另一个伙伴可以从`http://127.0.0.1:8001/download/test.txt`下载文件。
19+
1820
## 安装依赖
1921

2022
```bash
@@ -50,22 +52,18 @@ your_project/
5052
## 代码
5153

5254
```html showLineNumbers title="upload.html"
53-
<!doctype html>
54-
<html lang="zh">
55+
<!DOCTYPE html>
5556
<head>
56-
<meta charset="UTF-8">
57-
<title>上传文件</title>
57+
<title>Intranet Broadcast</title>
5858
</head>
59+
5960
<body>
60-
<h1>上传文件</h1>
61-
<form method="post" enctype="multipart/form-data">
62-
<input type="file" name="file">
63-
<input type="submit" value="上传">
64-
</form>
65-
{% if filename %}
66-
<p>文件上传成功!</p>
67-
<a href="{{ url_for('download_file', filename=filename) }}">下载 {{ filename }}</a>
68-
{% endif %}
61+
<img id="video" src="{{ video_url }}" alt="video">
62+
<audio autoplay style="display:none;">
63+
<source src="{{ audio_url }}" type="audio/x-wav; codec=pcm">Your browser does not support the audio
64+
element.
65+
</audio>
66+
6967
</body>
7068
</html>
7169
```
@@ -77,11 +75,12 @@ your_project/
7775
</head>
7876

7977
<body>
80-
<img id="video" src="{{ video_url }}" alt="视频流">
78+
<img id="video" src="{{ video_url }}" alt="video">
8179
<audio autoplay style="display:none;">
8280
<source src="{{ audio_url }}" type="audio/x-wav; codec=pcm">Your browser does not support the audio
8381
element.
8482
</audio>
83+
8584
</body>
8685
</html>
8786
```

0 commit comments

Comments
 (0)