A HTTP Server for upload file.
安装
pip install SimpleUpload
配置文件
使用环境变量指定配置文件的位置:
export SIMPLE_UPLOAD_SETTINGS="{path}/simple_upload.cfg"
配置项
RANDOM_KEY |
配置随机字符串,对应着提交的r字段,用于防止非法访问 |
CLIENT_PREFIX |
本地文件路径的前缀 |
SERVER_PREFIX |
服务器文件路径的前缀 |
运行
可以使用unicorn运行,安装unicorn:
pip install unicorn
启动:
gunicorn -b :8000 http_upload.server:app
上传文件
以HTTPie为例:
http -f POST yldev.lankaifa.com:8000 r={your random string} path={local path} f@{local_path}
Virtual Studio Code
可以结合vscode的插件Run on Save 或者Save and Run达到自动上传的目的
vscode的Save And Run插件的一个配置示例:
"saveAndRun": {
"commands": [
{
"match": "^/home/ubuntu/",
"cmd": "http -f POST ip:port r=r参数 path=${file} f@${file}"
}
]
}
Metadata
Release files for SimpleUpload 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| SimpleUpload-0.1.0.tar.gz | 2.8 kB | Details |
Release files / SimpleUpload-0.1.0.tar.gz
| Download URL | SimpleUpload-0.1.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea0b6a234c3b36c20f57032d66ccb7ef765be39d88e1673865d10ca4fcf677cf
|
|
BLAKE2b-256 checksum How to use checksums |
ce0c8b9b039a5fef5a2b537f97795ebce39e71fcc8a450ea7b8c588c97470dee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |