2

Using socket.io and jQuery how do I send a file (binary array) to my server? This is what I've tried:

<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>
MarkK
  • 968
  • 2
  • 14
  • 30
  • Possible duplicate of [Get Base64 encode file-data from Input Form](https://stackoverflow.com/questions/6978156/get-base64-encode-file-data-from-input-form) – Taplar Mar 05 '18 at 16:31

0 Answers0