Open Harpreet-rapido opened 3 years ago
const result = await superagent .post('url') .attach('driving_license', fs.createReadStream(filePath)) .field('dl_number', 'dlInfo.dlNo') .field('dob', 'dlInfo.dob') .field('apikey', 'apikey') .attach('photo', fs.createReadStream(filePath));
const result = await superagent .post('url') .attach('driving_license', fs.createReadStream(
)) .field('dl_number', 'dlInfo.dlNo') .field('dob', 'dlInfo.dob') .field('apikey', 'apikey') .attach('photo', fs.createReadStream(
));
Using attach multiple times does not allow the file to get attached.
This on the other hand works- await superagent .post('url') .field('rc_number', rcInfo.rcNumber) .field('apikey', 'apiKey') .attach('rcbook', fs.createReadStream(filePath));
await superagent .post('url') .field('rc_number', rcInfo.rcNumber) .field('apikey', 'apiKey') .attach('rcbook', fs.createReadStream(
const result = await superagent .post('url') .attach('driving_license', fs.createReadStream(
filePath)) .field('dl_number', 'dlInfo.dlNo') .field('dob', 'dlInfo.dob') .field('apikey', 'apikey') .attach('photo', fs.createReadStream(
filePath));
Using attach multiple times does not allow the file to get attached.
This on the other hand works-
await superagent .post('url') .field('rc_number', rcInfo.rcNumber) .field('apikey', 'apiKey') .attach('rcbook', fs.createReadStream(
filePath));