Created
December 1, 2015 07:00
-
-
Save anil826/e9cf9a12cfcc33acc0ac to your computer and use it in GitHub Desktop.
sending file using faye server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sendMessage = function(file) { | |
client.publish(channel, { file: file }); | |
} | |
var fr = new FileReader(); | |
fr.onload = function(event) { | |
sendMessage(event.target.result); | |
}; | |
fr.readAsDataURL($('.file')[0].files[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment