简体   繁体   中英

How to get Path and name of the Uploaded file in Node.js

Well I am creating a react based web application in which I want to upload docx/pdf and convert it to pdf/docx. For security reason there is no way to get file path in react. I wanna use libreoffice-convert package for above reason in which one should provide path of the file. I have heard that one can get path using node script but I am not able to figure it out.

Can somebody help me out by answering following questions

1.) Should I write file uploading code in Node.js script to get the path of the file?
2.) What are other ways to get file path (other than Node.js )?
3.) If there is other way to get file path than Node.js then can I configure it in react?

Please share any resource that can help me in doing the above task. Sorry for the poor english.

Thank you in advance

Use multer for handling file attachment in node js . multer will download the file and save it in provided path

docmentation of multer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM