New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

excel-upload

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

excel-upload

A node.js module for uploading and converting excel files into json.

latest
Source
npmnpm
Version
1.6.9
Version published
Maintainers
1
Created
Source

excel-upload

A node.js module for uploading and converting excel files into JSON.

Installing

npm install excel-upload

Requirements

  • node.js -- v4.5.0 or newer

Usage

Uploading, storing and parsing files is done asynchronous and the result is returned as a Promise.

Don't forget the enctype="multipart/form-data" in your form.

Browser:

<form action="/upload-documents" method="post" enctype="multipart/form-data">
  <input type="file" name="document" />
</form>

Controller:

import uploadFile from 'excel-upload';
  
static async post(req, res, next) {
 
    const upload = await uploadFile(req, "document-name", "./uploaded", "document");
 
      res.json(upload);
  }

NOTE: Before using excel-upload, make sure you create a corresponding folder in the root where uploaded files will be stored ("./uploaded").

API

KeyDescription
reqreq express.js object
fileNamename of the uploaded file
fileLocationlocation where uploaded file is stored
fieldNamefield name specified in the form

Keywords

node

FAQs

Package last updated on 04 Jan 2020

Did you know?

Socket

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