formidable
Advanced tools
Comparing version 1.0.3 to 1.0.4
if (global.GENTLY) require = GENTLY.hijack(require); | ||
var fs = require('fs'); | ||
var util = require('./util'), | ||
@@ -20,3 +21,3 @@ path = require('path'), | ||
this.keepExtensions = false; | ||
this.uploadDir = '/tmp'; | ||
this.uploadDir = IncomingForm.UPLOAD_DIR; | ||
this.encoding = 'utf-8'; | ||
@@ -36,2 +37,16 @@ this.headers = null; | ||
IncomingForm.UPLOAD_DIR = (function() { | ||
var dirs = [process.env.TMP, '/tmp', process.cwd()]; | ||
for (var i = 0; i < dirs.length; i++) { | ||
var dir = dirs[i]; | ||
var isDirectory = false; | ||
try { | ||
isDirectory = fs.statSync(dir).isDirectory(); | ||
} catch (e) {} | ||
if (isDirectory) return dir; | ||
} | ||
})(); | ||
IncomingForm.prototype.parse = function(req, cb) { | ||
@@ -38,0 +53,0 @@ this.pause = function() { |
{ | ||
"name": "formidable", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"dependencies": {}, | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -145,5 +145,7 @@ # Formidable | ||
#### incomingForm.uploadDir = '/tmp' | ||
#### incomingForm.uploadDir = process.env.TMP || '/tmp' || process.cwd() | ||
The directory for placing file uploads in. You can later on move them using `fs.rename()`. | ||
The directory for placing file uploads in. You can later on move them using | ||
`fs.rename()`. The default directoy is picked at module load time depending on | ||
the first existing directory from those listed above. | ||
@@ -150,0 +152,0 @@ #### incomingForm.keepExtensions = false |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2801928
1938
267
24
21