Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get file to transfer #13

Closed
HiloCoder opened this issue Jun 16, 2014 · 6 comments
Closed

Unable to get file to transfer #13

HiloCoder opened this issue Jun 16, 2014 · 6 comments

Comments

@HiloCoder
Copy link

I am trying to use socketio-file-upload from a context menu item click event. I am calling myinstance.prompt(), the dialog comes up, I select a file, hit Open. The server emits a "siofu_ready", then nothing else happens. The file is created in the specified server side dir but with 0 bytes. No errors in the console. Help would be appreciated.

@vote539
Copy link
Collaborator

vote539 commented Jun 16, 2014

Hi,

What's your browser version and node version and platform?

@HiloCoder
Copy link
Author

Hello,

Google Chrome vers. 35.0.1916.153 m
node v0.10.25
Windows XP


From: vote539 notifications@github.com
To: vote539/socketio-file-upload socketio-file-upload@noreply.github.com
Cc: HiloCoder folf@yahoo.com
Sent: Monday, June 16, 2014 1:51 PM
Subject: Re: [socketio-file-upload] Unable to get file to transfer (#13)

Hi,

What's you're browser version and node version and platform?

On Jun 16, 2014, at 1:38 PM, HiloCoder notifications@github.com wrote:

I am trying to use socketio-file-upload from a context menu item click event. I am calling myinstance.prompt(), the dialog comes up, I select a file, hit Open. The server emits a "siofu_ready", then nothing else happens. The file is created in the specified server side dir but with 0 bytes. No errors in the console. Help would be appreciated.


Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub.

@vote539
Copy link
Collaborator

vote539 commented Jun 17, 2014

Are you running Node.JS on Windows XP, or is that just your desktop operating system? Windows XP may be kind-of quirky with Node.JS, especially with regards to file streams and such.

Can you try running the following script and see if it creates the file correctly? It should make "hello.txt" that contains "hello world". This uses the same under-the-hood mechanism for writing the file as socketio-file-upload.

var fs = require("fs");
var buf = new Buffer("aGVsbG8gd29ybGQNCg==", "base64");
var path = "hello.txt";

var stream = fs.createWriteStream(path, { mode: "0666" });

stream.on("open", function(){
    setTimeout(function(){
        stream.write(buf);
        stream.end();
    }, 100);
});

@HiloCoder
Copy link
Author

Yes, running node js on Win XP for development and have had no problems.  I ran your script and it works correctly.


From: vote539 notifications@github.com
To: vote539/socketio-file-upload socketio-file-upload@noreply.github.com
Cc: HiloCoder folf@yahoo.com
Sent: Monday, June 16, 2014 4:59 PM
Subject: Re: [socketio-file-upload] Unable to get file to transfer (#13)

Are you running Node.JS on Windows XP, or is that just your desktop operating system? Windows XP may be kind-of quirky with Node.JS, especially with regards to file streams and such.
Can you try running the following script and see if it creates the file correctly? It should make "hello.txt" that contains "hello world". This uses the same under-the-hood mechanism for writing the file as socketio-file-upload.
var fs = require("fs");
var buf = new Buffer("aGVsbG8gd29ybGQNCg==", "base64");
var path = "hello.txt"; var stream = fs.createWriteStream(path, { mode: "0666" }); stream.on("open", function(){ setTimeout(function(){ stream.write(buf); stream.end(); }, 100);
});

Reply to this email directly or view it on GitHub.

@vote539
Copy link
Collaborator

vote539 commented Jul 27, 2014

Were you able to solve this issue?

You may also want to try the new useBuffer option in version 0.3 (which requires Socket.IO 1.0).

@HiloCoder
Copy link
Author

No, I ended up using formidable.

@vote539 vote539 closed this as completed Jul 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants