Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax file upload in node.js

I want to upload ajax file upload which uses xhr to send file data, at client m using this http://valums.com/ajax-upload/ how i will accept this data on node and save the file to server by node.js , which module i need to use in node.js?

like image 205
XMen Avatar asked May 13 '11 08:05

XMen


People also ask

Can we upload file using AJAX?

Ajax file uploadsA JavaScript method must be coded to initiate the asynchronous Ajax based file upload; A component must exist on the server to handle the file upload and save the resource locally; The server must send a response to the browser indicating the JavaScript file upload was successful; and.

How upload Ajax file to MVC?

Go to File->New->Project. Give a suitable name to the Application. Click OK. As you can see in the above image, two files are sent to C# ActionMethod, and both will be uploaded now.


1 Answers

I've created an uploader with progress bar using the formidable module, it's really easy to use and provides a lot of useful callbacks.

Have a look here:

https://github.com/felixge/node-formidable (scroll down to get the Docs)

http://debuggable.com/posts/parsing-file-uploads-at-500-mb-s-with-node-js:4c03862e-351c-4faa-bb67-4365cbdd56cb

like image 76
sled Avatar answered Oct 13 '22 15:10

sled