问题描述
我有一个 socket.io客户端, socket.io服务器在node.js中监听。我想通过socket.io上传文件到服务器。因为我的socket.io客户端是在Apache下。而socket.io服务器在node.js中。我想代码上传node.js中的文件。但我怎么能发送文件数据到Node.js监听套接字。
我已经尝试使用node.js服务器上传文件。这个链接在这里,但是这个代码并没有使用这个socket.io。但我原来的项目是使用socket.io。
。
本教程使用node.js和socket.io上传文件。
I have a socket.io client to whom socket.io server is listening in node.js.I want to upload a file to server by socket.io. because my socket.io client is under apache. and socket.io server is in node.js. I want to code uploading of file in node.js. But how i can send the file data to the node.js listening to socket.
I have tried the upload of a file using node.js server. This link is here but the this code does not use the socket.io with this. But my original project is using the socket.io.
http://rahulmehta1.wordpress.com/2011/04/26/uploading-a-file-in-node-js-by-formidable/
How can i do this with the socket.io server?
The checked answer is invalid as of Jul 3rd 2012.
Read by yourself this tutorial on NetTuts.This tutorial uses node.js and socket.io to upload a file.
这篇关于我可以通过node.js中的socket.io将文件上传到服务器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!