I posted same question on stackoverflow but there are no answers why is this happening with your library.
I thought it would best to write about this by raising issue on this repo.
I built a program where a user can send request with a PDF URL then sever download it and forward into an external API endpoint. Now, the code able to download file but it hit this error when it start to read the file.
I posted same question on stackoverflow but there are no answers why is this happening with your library.
I thought it would best to write about this by raising issue on this repo.
I built a program where a user can send request with a PDF URL then sever download it and forward into an external API endpoint. Now, the code able to download file but it hit this error when it start to read the file.
`const fs = require('fs'); const url = require("url"); const path = require("path"); const http = require('http') const rp = require('request-promise'); const app = express(); const port = 8999;
app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true }));
app.post('/upload-invoice', (req, res) => {
var parsed = url.parse(req.body.FileURL); var filename = (path.basename(parsed.pathname)); var downloaded_file_path =
invoices/${filename}
;function download() {
}
async function upload() {
});
app.listen(port) `
I also tried an another code but it too not working:
formData: { name: filename, file: { value: fs.createReadStream(downloaded_file_path), options: { filename: filename, contentType: 'application/pdf' } } }