-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform-data.ts
More file actions
27 lines (23 loc) · 724 Bytes
/
form-data.ts
File metadata and controls
27 lines (23 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// import * as FormData from "form-data";
// import { request } from "http";
// import { createReadStream, createWriteStream } from "fs";
// const readStream = createReadStream("./logo-test.jpg");
// const writeStream = createWriteStream("./file4.txt");
// const form = new FormData();
// form.append("photo", readStream);
// form.append("firstName", "Cybertech");
// form.append("lastName", "Holma");
// // const req = request(
// // {
// // host: "localhost",
// // port: "5000",
// // path: "/upload",
// // method: "POST",
// // headers: form.getHeaders(),
// // },
// // (res) => {
// // console.log(res.statusCode);
// // }
// // );
// // form.pipe(req);
// form.pipe(writeStream);