python快速搭建文件上传下载服务器

文件下载服务:

python3 -m http.server 8888

写个简易脚本后台运行,文件内容如上。
nohup ./share.sh >> share.log 2>&1 &

文件上传服务:

安装模块
pip install droopy

下载启动脚本
wget http://stackp.online.fr/wp-content/uploads/droopy

运行服务,默认8000端口
python ./droopy -m "now can upload file"

将上述命令写成脚本后台运行
nohup bash droopy.sh >> droopy.log 2>&1 &

当然也能指定端口:
Usage: droopy [options] [PORT]
Options:
-h, --help show this help message and exit
-d DIRECTORY, --directory DIRECTORY set the directory to upload files to
-m MESSAGE, --message MESSAGE set the message
-p PICTURE, --picture PICTURE set the picture
–dl provide download links
–save-config save options in a configuration file
–delete-config delete the configuration file and exit

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容