Giter Site home page Giter Site logo

Comments (7)

nkzawa avatar nkzawa commented on July 24, 2024

Can you post client side too?

from socket.io-stream.

cobaki avatar cobaki commented on July 24, 2024

I'm using angularjs and a custom directive to get the file. But I've also tested with jQuery and the example you provide. In both cases the issue persits.

$('#file').change(function(e) {
    var file = e.target.files[0];
    var stream = ss.createStream();

    // upload a file to the server. 
    ss(socket).emit('file', stream, {size: file.size});
    ss.createBlobReadStream(file).pipe(stream);
});

Getting the file size and creating the stream works just fine. The 'file' event is emitted correctly as well, it's just that on the server side I'm not getting any data...

from socket.io-stream.

nkzawa avatar nkzawa commented on July 24, 2024

hmm, I tested the latest version again and it works good for me.

How did you load socket.io-stream on client side?
What kind of errors do you get actually?
Can you post dump of logs if possible ?

// show logs
DEBUG=socket.io-stream* node your-server.js

from socket.io-stream.

cobaki avatar cobaki commented on July 24, 2024

Thank you for your quick responses trying to help me! I've found my error: In angularjs, I set up a factory that was wrapping socket 'on' and 'emit' events in order to automatically inform the scope, this interfered with the streaming calls.

from socket.io-stream.

BilalBoulifa avatar BilalBoulifa commented on July 24, 2024

@cobaki I'm facing the same issue can you please explain me how it was resolved?

from socket.io-stream.

cobaki avatar cobaki commented on July 24, 2024

@fithwith be sure to create the stream ss(socket) on the socket that was returned by io.connect(...)and not the one returned by your factory function. I just stored a reference to the initial socket in my factory and used it anytime I had to create a stream.

from socket.io-stream.

BilalBoulifa avatar BilalBoulifa commented on July 24, 2024

@cobaki thank you for your quick reply, I did the same but I'm still facing the issue.
I'm using angularjs with the module ui.router, the first time I open the page where I can upload files its working fine, I can upload multiple files without problem, but once I visit another page (state because I'm using ui.router) and come back again to the upload page then the problem appear, I'm using the socket given by io.connect(), I emit the event, the data pass to the server, the stream also pass, but once the server try to call stream.pipe then the message pipe undefined appear.
I don't know if you have an idea from where it can come, its a little bit different than your case because I'm receiving the data and the stream correctly.
if you have an idea it wil be more than welcome :) thank you again @cobaki

from socket.io-stream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.