Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update incoming_form.js #269

Open
wants to merge 1 commit into from

4 participants

Titus Tienaah Felix Geisendörfer shaoman swayok
Titus Tienaah

fixing, fs: missing callback Error: ENOENT, unlink

Titus Tienaah intdxdt Update incoming_form.js
fixing, fs: missing callback Error: ENOENT, unlink
56dc1c9
Felix Geisendörfer
Owner

Can you provide a test case for this?

shaoman

Can you help me?
when I use the form.parse always occur “[Error : Request aborted ]” ? Can you tell me why?
will my code just from here http://www.nodebeginner.org/index-zh-cn.html.

shaoman

also when I debug into the parse method , I want to watch "this" is what And
happened this :

There was an internal error in Node's debugger. Please report this bug.
Cannot convert object to primitive value
TypeError: Cannot convert object to primitive value
at _debugger.js:1318:43
at Array.forEach (native)
at wait (_debugger.js:1317:22)
at _debugger.js:1309:7
at _debugger.js:1005:7
at _debugger.js:404:5
at Client._onResponse (_debugger.js:260:5)
at Protocol.execute (_debugger.js:134:14)
at Client. (_debugger.js:175:14)
at Client.EventEmitter.emit (events.js:95:17)

Titus Tienaah

shaoman,
form.parse works as expected, i am not sure how you arrived at the bug.
i tried the example from your link : http://www.nodebeginner.org/index-zh-cn.html.
here is the source : https://dl.dropboxusercontent.com/u/40241880/example.zip
works as expected.

swayok

Getting fs: missing callback Error: ENOENT, unlink /path/to/uploaded/file
Can't really find out why this is happening. At least this fix seems to be fixing crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 7, 2014
  1. Titus Tienaah

    Update incoming_form.js

    intdxdt authored
    fixing, fs: missing callback Error: ENOENT, unlink
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/incoming_form.js
14 lib/incoming_form.js
View
@@ -279,7 +279,19 @@ IncomingForm.prototype._error = function(err) {
if (Array.isArray(this.openedFiles)) {
this.openedFiles.forEach(function(file) {
file._writeStream.destroy();
- setTimeout(fs.unlink, 0, file.path);
+ //setTimeout(fs.unlink, 0, file.path); //BUG
+ var unlink_cb = function () {
+ fs.unlink(file.path, function (ex) {
+ if (ex) {
+ console.log('incomplete file unlink error : modified formidable : titus');
+ }
+ })
+ };
+ fs.exists(file.path, function (exists) {
+ if (exists) {//attemp unlink on incomplete files
+ unlink_cb();
+ }
+ });
});
}
};
Something went wrong with that request. Please try again.