Skip to content

Forward multipart/form-data file upload into a specified server.

Notifications You must be signed in to change notification settings

dharijanto/multer-proxy-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multer Proxy Storage

This is a custom multer storage engine that proxy the received file into a remote server. The proxy is forwarded as multipart/form-data.

Install

npm install --save multer-proxy-storage

Usage

In this example we are forwarding user uploaded file into remote server http://www.example.com/upload, with the file identified with the parameter 'file'.

var multer = require('multer')
var MulterProxyStorage = require('multer-proxy-storage')

this.routePost('/uploadFile',
  (req, res, next) => {
    multer({
      storage: MulterProxyStorage(
        {
          serverPath: `http://www.example.com/upload`,
          fileParamName: 'file'
        }),
      preservePath: true
    }).array('file')(req, res, next)
  }, (req, res, next) => {
    res.send('Success!')
  })

License

Multer-Proxy-Storage is released under the MIT license.

About

Forward multipart/form-data file upload into a specified server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published