# ssv-file-upload

> ====================

Latest version **1.1.11** (published 2021-01-14) · bankonly license · 0 weekly downloads

## Install

```sh
npm install ssv-file-upload
pnpm add ssv-file-upload
yarn add ssv-file-upload
bun add ssv-file-upload
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.11 |
| Published | 2021-01-14 |
| First published | 2020-08-09 |
| Weekly downloads | 0 |
| License | bankonly |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | bank |
| Maintainers | bankonly |
| Keywords | easy way to make image upload with resize option |

## Links

- npm: https://www.npmjs.com/package/ssv-file-upload
- npm.io page: https://npm.io/package/ssv-file-upload

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.1.11 (latest) — 2021-01-14
- 1.1.10 — 2021-01-09
- 1.1.9 — 2021-01-09
- 1.1.8 — 2021-01-09
- 1.1.7 — 2021-01-09
- 1.1.6 — 2020-10-30
- 1.1.5 — 2020-10-30
- 1.1.4 — 2020-10-28
- 1.1.3 — 2020-10-20
- 1.1.2 — 2020-09-24
- 1.1.1 — 2020-09-24
- 1.0.10 — 2020-08-14
- 1.0.9 — 2020-08-11
- 1.0.8 — 2020-08-10
- 1.0.7 — 2020-08-10
- … 7 more at https://npm.io/package/ssv-file-upload/versions

## README

# Register

====================

```javascript
const file = require("ssv-file-upload");

app.use(file.ssv_file_upload);

// ENV

IMAGE_SIZE_ALLOW = 3000000; // bytes = 3MB
IMAGE_TYPE_ACCEPT = jpg, png, jpeg, mp4, mp3, mpeg, wave;
```

# Get start ,image ,videos, files

====================

```javascript

const path = "./../../img/"
// 1.
file.fileUpload({
    file:req.files.img,// img body
    path:path
});

// response = {data,code,message,status}


// 2.
file.fileUpload({
    file:req.files.img,// img body
    path:path,
    fileType:"jpg",
    originalName:true // if false file's name will be uuid v4
});

// 3.
file.fileUpload({
    file:req.files.img,// img body
    path:path,
    fileType:"jpg",
    resize:[800,500],// define your resize image
    limit:3
});

```

| Param         | type                       | desc                          |
| ------------- |:--------------------------:| -----------------------------:|
| file          | file as array or one file | file from form data            |
| path          | string                     | destination                   |
| fileType      | string                     | define file's format          |
| resize        | array as number            | resize image                  |
| limit         | number                     | allow to upload by limit      |
| originalName  | boolean                    | use original name of file     |
| removeSpace   | boolean                    | remove space from file's name |

# function can be use

uploadImageMany
fileUpload
remove
imageValidate
createDirIfNotExist
resizeImage
removeFile
removeFileMany
uploadImage

---
_Source: https://npm.io/package/ssv-file-upload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
