zeanium-node
Advanced tools
Comparing version 0.4.22 to 0.4.23
{ | ||
"name": "zeanium-node", | ||
"version": "0.4.22", | ||
"version": "0.4.23", | ||
"description": "Zeanium for Node.js, simple http server and custome your business.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -179,31 +179,38 @@ /** | ||
} else { | ||
var _upload = this.__getUploadInfo(), | ||
_incomingForm = new formidable.IncomingForm(), | ||
_uploadDir = _upload.root + _upload.temp; //文件上传 临时文件存放路径; | ||
var _ct = _request.headers['content-type']||''; | ||
if(_ct.indexOf('text/xml')!=-1){ | ||
this._$get = (url.parse(_request.url, true).query||{}); | ||
callback(this._$get); | ||
}else { | ||
var _upload = this.__getUploadInfo(), | ||
_incomingForm = new formidable.IncomingForm(), | ||
_uploadDir = _upload.root + _upload.temp; //文件上传 临时文件存放路径; | ||
if(!fs.existsSync(_upload.root)){ | ||
fs.mkdirSync(_upload.root); | ||
} | ||
if(!fs.existsSync(_upload.root)){ | ||
fs.mkdirSync(_upload.root); | ||
} | ||
if(!fs.existsSync(_uploadDir)){ | ||
fs.mkdirSync(_uploadDir); | ||
if(!fs.existsSync(_uploadDir)){ | ||
fs.mkdirSync(_uploadDir); | ||
} | ||
//_incomingForm.keepExtensions = true; //使用文件的原扩展名 | ||
_incomingForm.uploadDir = _uploadDir; | ||
_incomingForm.parse(_request,function(error, fields, files){ | ||
if(error){ | ||
console.log(error); | ||
zn.error('Request.js: formidable.IncomingForm parse error, ' + error.toString()); | ||
} else { | ||
_data = _request.data = { | ||
fields: fields, | ||
files: files, | ||
uploadConfig: _upload | ||
}; | ||
this._$post = fields; | ||
this._$files = files; | ||
this._$uploadConfig = _upload; | ||
callback(_data); | ||
} | ||
}.bind(this)); | ||
} | ||
//_incomingForm.keepExtensions = true; //使用文件的原扩展名 | ||
_incomingForm.uploadDir = _uploadDir; | ||
_incomingForm.parse(_request,function(error, fields, files){ | ||
if(error){ | ||
zn.error('Request.js -- line 110 message: formidable.IncomingForm parse error. ' + error.toString()); | ||
} else { | ||
_data = _request.data = { | ||
fields: fields, | ||
files: files, | ||
uploadConfig: _upload | ||
}; | ||
this._$post = fields; | ||
this._$files = files; | ||
this._$uploadConfig = _upload; | ||
callback(_data); | ||
} | ||
}.bind(this)); | ||
} | ||
@@ -210,0 +217,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
301174
6409