使用socket.io和 jQuery 如何将文件(二进制数组)发送到我的服务器?这就是我尝试过的:
<script type="text/javascript" charset="utf-8">
$(document).ready(function () {
var socket = io.connect('http://' + document.domain + ':' + location.port);
$('form#upload_form').submit(function (event) {
//var File fileObj = new File($('#ssa_data').val());
socket.emit('certificate_upload', {transport_key: $('#small_file').val()});
return false;
});
});
</script>