pml-uploadfile
v1.0.4
Published
test
Downloads
3
Readme
pml-uploadfile
This is a file upload plug-in,Support file stream and string upload。
Note: Windows is partially supported, see #22
Install
$ npm i pml-uploadfile --save
Usage
Introducing plug-ins into projects
const {uploadStreamFile,uploadStringFile} = require('pml-uploadfile');
const result = await uploadStringFile(opts,baseDir);
Return value
{code: 1, urlPath: ""}
{code: 0, error: ""}
- Description of parameters
uploadStreamFile (opts,baseDir):
let opts = ctx.getFileStream() // file stream
baseDir: app.config.baseDir // default:'';
uploadStringFile (opts,baseDir):
let opts = {
fileData:fileData, // Picture Base64 byte stream // must
fileName:fileName, // Save the name of the image // default:time stamp
fileFormat:fileFormat, //Save the format of the picture // default:jpg
filePath:filePath // Path to save pictures //default: app/public
}
Questions & Suggestions
More and better inspections will continue to be updated