nodejs 上传文件 放在指定目录
发布于 11 年前 作者 cxh80301983 5387 次浏览 最后一次编辑是 8 年前

用什么方法放在指定目录呢?

比如 var target_path = ‘./datas/images/’ + req.files.thumbnail.name;

为什么一直是临时目录 { thumbnail: { fieldName: ‘thumbnail’, originalFilename: ‘Box2dWeb-2.1a.3.zip’, path: ‘/var/folders/h6/84pndq_d663bq3fsdrf4bsk80000gn/T/8676-3pi5it.zip’, headers: { ‘content-disposition’: ‘form-data; name=“thumbnail”; filename=“Box2dWeb-2.1a.3.zip”’, ‘content-type’: ‘application/zip’ }, ws: { _writableState: [Object], writable: true, domain: null, _events: [Object], _maxListeners: 10, path: ‘/var/folders/h6/84pndq_d663bq3fsdrf4bsk80000gn/T/8676-3pi5it.zip’, fd: null, flags: ‘w’, mode: 438, start: undefined, pos: undefined, bytesWritten: 106341, closed: true, open: [Function], _write: [Function], destroy: [Function], close: [Function], destroySoon: [Function], pipe: [Function], write: [Function], end: [Function], setMaxListeners: [Function], emit: [Function], addListener: [Function], on: [Function], once: [Function], removeListener: [Function], removeAllListeners: [Function], listeners: [Function] }, size: 106341, name: ‘Box2dWeb-2.1a.3.zip’, type: ‘application/zip’ } }

回到顶部