Have ideas to improve npm?Join in the discussion! »

    images-upload-middleware

    1.1.1 • Public • Published

    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);

    Install

    npm i images-upload-middleware

    DownloadsWeekly Downloads

    17

    Version

    1.1.1

    License

    MIT

    Last publish

    Collaborators

    • avatar
    • avatar