Because remote desktop connections are often used, file transfer between local PCs and remote PCs has always been a common problem. I tried to use vftp to build FTP services, but this service is disabled on many vps, and it must be used on windows. Setting it up is cumbersome. Fortunately, I found the github project ods-im / CuteHttpFileServer , and built a simple file transfer service with this software, here is a record.
1. Installation
Search for this project in github, and download the package corresponding to the system platform; after decompression, there is only one file (chfs or chfs.ext). That's all.
The following takes the Linux AMD64 platform as an example to introduce how to set it as a Daemon service
2. Write the startup script
2.1 Using chfs as system software
mv chfs /usr/bin/ ## 将chfs 移动到位
2.2 Writing scripts
vim /etc/systemd/system/chfs.sh
#如下,设置了中转目录,监听的端口; 注意要将Public的读写权限进行开放
#! /bin/bash
/usr/bin/chfs --path=/var/www/html/Public --port=54321
Note: there are other parameters, you can set the login account, password, etc., see the instructions of the software
2.3 Write systemd service
vim /etc/systemd/system/chfs.service
[Unit]
Description=Chfs file Service
After=network.target
[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/bin/bash /etc/systemd/system/chfs.sh
LimitNOFILE=1048796
[Install]
WantedBy=multi-user.target
3. Start the chfs service and set it to start with boot
systemctl start chfs.service
systemctl status chfs.service
systemctl enable chfs.service
4. Test
Browser input: http://your-web-address:54321
It can be uploaded, or you can conveniently directly cp the file to the shared folder on the server, and it can be displayed after refreshing