5

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?

2 Answers 2

6

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

Sign up to request clarification or add additional context in comments.

5 Comments

Have u created Ajax file upload ?
I think using XHR (Ajax) to upload a file should work with formidable but uploading files using an XMLHttpRequest is only supported in HTML5 and is not supported by all browsers yet (especially IE)...
I tried using formidable but getting error please see this question stackoverflow.com/questions/5988727/ajax-file-upload-in-node-js
It looks very promising but lacks some HTML file presenting progress bars etc. Could you please provide one?
@Jacek Wojcik, the progress bar can be done on the client-side - today I would recommend you to stick with HTML5 file uploads whenever possible, just google it. As an alternative for backward-compatibility a library called plupload might be a good match.
0

due to the lack of an example file in valums ajax-uploader, I've just created one.

It catches up the XHR upload if possible, alternatively falling back to the old form-based method. All in conclusion to valums ajax-uploader.

https://github.com/aldipower/file-uploader/blob/master/server/nodejs.js

Maybe Valums will accept the pull request some time and the sample file gets merged in the standard repository.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.