Socket
Socket
Sign inDemoInstall

images-upload-middleware

Package Overview
Dependencies
14
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    images-upload-middleware

express middleware for images upload


Version published
Maintainers
2
Install size
179 kB
Created

Readme

Source

images-upload-middleware

NPM

Express middleware for images upload

Usage

npm i -S images-upload-middleware

Prams

  • savePath: string - path where you want to save images;
  • servePath: string - serve path;
  • multiple: boolean - allows to upload a bunch of images;
  • rename: boolean - if false, then do not rename image default: true;

Examples

import express from 'express';
import imagesUpload from 'images-upload-middleware';

const app = express();

app.use('/static', express.static('./static'));

app.post('/multiple', imagesUpload(
	'./static/multipleFiles',
	'http://localhost:8080/static/multipleFiles',
	true
));

app.post('/notmultiple', imagesUpload(
	'./static/files',
	'http://localhost:8080/static/files'
));

app.post('/notrename', imagesUpload(
	'./static/originalNameFiles',
	'http://localhost:8080/static/originalNameFiles',
	true,
	false
));

app.listen(8080);

Keywords

FAQs

Last updated on 21 Dec 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc