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

Piping http request stream to ftp stream #16

Closed
martinkadlec0 opened this issue Jun 17, 2012 · 2 comments
Closed

Piping http request stream to ftp stream #16

martinkadlec0 opened this issue Jun 17, 2012 · 2 comments

Comments

@martinkadlec0
Copy link

Hi, this is part of code I'm trying to make working:

function uploadFile(req, res) {
    res.writeHeader(200, {'Content-Type': 'text/html'});
    res.write('Uploading, please wait!');

    ftp.put(req, 'test.txt', function(e) {
        if (e) throw e;
        res.end('<br>__uploaded__');
        console.log('ftp: uploaded');
        ftp.end();
    });
}

The "test.txt" file is created on my FTP server, but nothing is written into it. Why? I have no problem to pipe http request stream to eg. process.stdout. Wiriting content of some file to test.txt with file system stream works as well.

@mscdex
Copy link
Owner

mscdex commented Jul 16, 2012

Hi, did you try this on 0.1.3?

@martinkadlec0
Copy link
Author

It works perfectly in 0.1.3. Thank you :)

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