我尝试在节点Js中上传文件的进度...我使用请求库中集成的表单数据库...
有没有办法让我的进步?
var torrentStream = require('torrent-stream');
var express = require('express');
var http = require('http');
var request
var app = express();
var request = require('request');
var zipFolder = require('zip-folder');
var magnet = require('magnet-uri')
var FormData = require('form-data');
var fs = require('fs');
var formData = {
files : fs.createReadStream(__dirname + '/archive.zip')
};
request.post({url:'http://request.url', formData: formData},
function(err, httpResponse, body) {
if (err) {
return console.error('upload failed:', err);
}
console.log('Upload successful! Server responded with:', body);
});