Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Sets encoding for incoming form fields.
form.uploadDir = "/my/dir";
```
Sets the directory for placing file uploads in. You can move them later on using
`fs.rename()`. The default is `os.tmpDir()`.
`fs.rename()`. The default is `os.tmpdir()`.

```javascript
form.keepExtensions = false;
Expand Down
2 changes: 1 addition & 1 deletion lib/incoming_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function IncomingForm(opts) {
this.maxFields = opts.maxFields || 1000;
this.maxFieldsSize = opts.maxFieldsSize || 2 * 1024 * 1024;
this.keepExtensions = opts.keepExtensions || false;
this.uploadDir = opts.uploadDir || os.tmpDir();
this.uploadDir = opts.uploadDir || os.tmpdir();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to fix the failed test, how about

this.uploadDir = opts.uploadDir || (os.tmpdir || os.tmpDir)();

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gswalden I'm pretty sure that Node.js 0.8 support can and should be dropped. I.e. not break on a purpose, but don't care about it specifically, so this doesn't need code complication.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but I have no write access to this repo, just trying to usher this along.

this.encoding = opts.encoding || 'utf-8';
this.headers = null;
this.type = null;
Expand Down