Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not save the file, pipe is undefined #2

Closed
afcastano opened this issue Mar 28, 2016 · 6 comments · May be fixed by WorldViews/FlowerGarden#6, Sollunad/RaidOrgaPlus#440 or praburocking/nodetemplateserver#3

Comments

@afcastano
Copy link

Hi, after the upload completes, I try to save the file according to your example using the mv function but I always get this exception:

TypeError: this.data.pipe is not a function
at Object.req.files.(anonymous function).mv (/Users/pam/Documents/pipe/server-file-browser/node_modules/express-fileupload/jslib/index.js:40:25)
at Object.saveSubtitle (/Users/pam/Documents/pipe/server-file-browser/server/src/modules/Files.js:170:22)
at /Users/pam/Documents/pipe/server-file-browser/server/src/app.js:111:11
at Layer.handle as handle_request
at next (/Users/pam/Documents/pipe/server-file-browser/node_modules/express/lib/router/route.js:100:13)
at Route.dispatch (/Users/pam/Documents/pipe/server-file-browser/node_modules/express/lib/router/route.js:81:3)
at Layer.handle as handle_request
at /Users/pam/Documents/pipe/server-file-browser/node_modules/express/lib/router/index.js:227:24
at Function.proto.process_params (/Users/pam/Documents/pipe/server-file-browser/node_modules/express/lib/router/index.js:305:12)
at `/Users/pam/Documents/pipe/server-file-browser/node_modules/express/lib/router/index.js:221:12

I am running on node 4.2.2 and express 4.8.1

Temporary I had to save the data manually.

Thanks for your help!

@santekotturi
Copy link

Same error here:

uploading file:  { name: 'activity.jpg',
  data: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff e1 00 8a 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 01 87 69 00 04 00 00 00 01 00 00 ... >,
  encoding: '7bit',
  mimetype: 'image/jpeg',
  mv: [Function] }
TypeError: this.data.pipe is not a function
    at Object.req.files.(anonymous function).mv (/Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/express-fileupload/jslib/index.js:40:25)
    at /Users/santekotturi/Developer/digitalocean/test-env/activity-backend/routes/activity.js:35:20
    at Layer.handle [as handle_request] (/Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/express/lib/router/route.js:131:13)
    at Route.dispatch (/Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/express/lib/router/layer.js:95:5)
    at /Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/express/lib/router/index.js:277:22
    at Function.process_params (/Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/express/lib/router/index.js:330:12)
    at Busboy.next (/Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/express/lib/router/index.js:271:10)
    at emitNone (events.js:72:20)
    at Busboy.emit (events.js:166:7)
    at Busboy.emit (/Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/busboy/lib/main.js:31:35)
    at /Users/santekotturi/Developer/digitalocean/test-env/activity-backend/node_modules/busboy/lib/types/multipart.js:52:13
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)

Running
node : 4.4.2
express: 4.13.4
express-fileupload : 0.0.4

@chenzhutian
Copy link

still have this bugs.. node:v5.0.0, express v4.13.4 express-fileupload v0.0.4

@pajtai
Copy link
Contributor

pajtai commented Apr 22, 2016

@richardgirges any progress on reviewing my fixes? I'd love to get this fix pulled in.

@richardgirges
Copy link
Owner

@pajtai apologies for the lag. Will review and pull the fix in by end of day.

richardgirges added a commit that referenced this issue Apr 22, 2016
Adding streamifier to make buffer into a stream - Closes #2
@richardgirges
Copy link
Owner

@pajtai Thanks for your pull request. Just updated the package in NPM.

@pajtai
Copy link
Contributor

pajtai commented Apr 23, 2016

nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment