开发者

sending and receiving files with PHP jQuery

How can I send and receive files live like in yahoo chat? i.e if I send the file than the user on the other end will only get that file if he click on the accept button and if he click deny than the file should not upload and should be deleted 开发者_JAVA技巧from the server... I want to do that via PHP jQuery $.ajax().


This is a rather complicated question, and not easily addressed. Here are a couple things:

  1. You'll want a way to identify conversations. You wouldn't want your file-request getting intercepted by a completely different set of people.
  2. You'll probably want to invoke some form of long-polling that will send a request to the server, who in turn will send a request (link) to the other user, who, when clicks the link, the server will return the first request back to you, initializing your upload.
  3. You can use the jQuery Plugin Uploadify for the asynchronous uploads, and late-initialization from a server-response.
  4. You may also want to keep a database table to list all of the file shared by any particular conversation. This would be queries to find out if new files need to be listed in the users windows.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜