Closed EdwardZZZ closed 4 years ago
const fs = require('fs'); const FormData = require('form-data'); const form = new FormData(); const filePath = './20170208092539_k2mLr.jpeg'; // path.resolve('') const picStream = fs.createReadStream(filePath); form.append('file', picStream, { knownLength: picStream.knownLength }) form.submit('https://*.com/picUpload', (err, res) => { res.on('data', (data) => { console.log(data.toString()); }) })