我对Linux非常陌生,我不确定我想要做的事情能否实现。
我有一个程序,运行24/7,将我的一个服务器上传到云端。唯一的问题是,它正在扼杀我的带宽。
所以我的想法是让它在00:05到05:55之间运行,没有人会在晚上这个时候忙碌。
所以,就像:
If $(date +"%T") < 05:55 then
backup.sh
else
killbackup.sh
fi
最终用户通过web应用程序上载文件。为此,我使用。
在服务器端,我使用将上传的文件通过管道传输到我正在使用的基于云的文件服务。
代码如下:
//The function called when file is uploaded
function (req, res) {
var form = new formidable.IncomingForm();
form.parse(req);
form.on('file', function (name, file) {
//Code that uploads the file to the
现状
在应用程序的前端,我有一个简单的表单,在将数据上传到后端之前,我可以从其中获取数据的3个参数:
形式子函数
e.preventDefault();
const data = new FormData(e.currentTarget) //contains a string key called title
data.append("file", JSON.stringify(file)) //file object
data.append("description", JSON.stringify(editorState)) //description