ssv-file-upload

1.1.11 • Public • Published

Register

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

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

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

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

Package Sidebar

Install

npm i ssv-file-upload

Weekly Downloads

2

Version

1.1.11

License

bankonly

Unpacked Size

10.9 kB

Total Files

3

Last publish

Collaborators

  • bankonly