@admoni/upload-module 中文文档教程
Upload file module
Installation
npm install --save @admoni/upload-module
Usage
const uploadFile = require("@admoni/upload-module")
app.post('/upload', uploadFile(directory, process.env.ID, process.env.SECRET, filetype).single | array | fields, function(req, res, next) {
res.send('Successfully uploaded ' + req.file.location + ' files!')
// File - req.file.location
// Filetype can be image/png, image/gif, image/jpg, application/zip e.t.c
})
// To delete a file
const { deleteFile } = require("@admoni/upload-module")
deleteFile(ID, SECRET, files)
// files is an array of Object, with Key as the key and req.file.key as the value
Upload file module
Installation
npm install --save @admoni/upload-module
Usage
const uploadFile = require("@admoni/upload-module")
app.post('/upload', uploadFile(directory, process.env.ID, process.env.SECRET, filetype).single | array | fields, function(req, res, next) {
res.send('Successfully uploaded ' + req.file.location + ' files!')
// File - req.file.location
// Filetype can be image/png, image/gif, image/jpg, application/zip e.t.c
})
// To delete a file
const { deleteFile } = require("@admoni/upload-module")
deleteFile(ID, SECRET, files)
// files is an array of Object, with Key as the key and req.file.key as the value
更多
你可能也喜欢
- 7s-aura-lwc-eslint-parser 中文文档教程
- @0655-dev/typescript-package-template 中文文档教程
- @10play/navigation 中文文档教程
- @128technology/netconfetti 中文文档教程
- @2003scape/rsc-data 中文文档教程
- @2plgiap/react-leaflet-control 中文文档教程
- @3yourmind/vue-hooks 中文文档教程
- @4a/sdk-configure 中文文档教程
- @4keys/svg.resize.js 中文文档教程
- @4tw/vue-cli-plugin-pdfjs-viewer 中文文档教程