Search code examples
node.jsfile-uploadexpresssftpmulter

Upload File to remote server using Nodejs Multer


Can Nodejs Multer be used to upload files on remote server? If yes, then where do I provide the host name, host credentials, etc?


Solution

  • As per my current knowledge and based on Multer API documentation, I don't think Multer has the capability to upload/sftp files to a remote Storage Server. The use of Multer is to provide multiple useful events while uploading your file to the server where your Node.js application is deployed.

    If you want to upload file to remote storage server other than the server where your Node.js application is deployed then consider using these modules ssh2/sftp-upload/scp2. I have few code samples for file upload/sftp using these modules here: https://github.com/prabhash1785/NodeJS/tree/master/fileupload