明树Git Lab

Commit a52fcf71 authored by zengfanpei's avatar zengfanpei

upload

parent 2d3cc0c9
const ExcelJS = require('exceljs');
const path = require('path');
const _ = require('lodash');
async function upload(req, res, next) {
try {
// console.log(req.file, req.body);
let path = _.last(String(req.file.path).split('/mnt/vdb1'));
let ret = await DB.File.create({
originalname: req.file.originalname,
mimetype: req.file.mimetype,
filename: req.file.filename,
path: req.file.path,
path,
originalpath: req.file.path,
size: req.file.size,
});
res.sendData(ret);
......
......@@ -26,6 +26,9 @@ const fileSchema = new Schema({
path: {
type: String,
},
originalpath: {
type: String,
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment