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

Already on GitHub? Sign in to your account

Make example for multipart response #1628

guilloche opened this Issue May 17, 2013 · 2 comments


None yet
3 participants

I don't find any example for multipart response, but parsing multipart request working very well.

With pipe?

var path    = require('path');
var ch  = require('child_process');
app.all('/:myImage-:num', function(res, req){
   var file =path.resolve( __dirname + req.params.myImage + ".jpg" );
    var convert = ch.spawn('convert', [ file, '-resize', req.params.num, '-' ] );
    res.contentType( "image/jpg" );
    convert.stdout.pipe( res );
    convert.stderr.pipe( process.stderr );
} );

Although not multipart, but the speed is extremely fast! We are talking about 100 ms to 1 sec. Depended on the size of the image, but that if it is better than multipart, that this sent the file from which to connect to the url.


tj commented Jun 2, 2013

Express doesn't have anything for multipart responses

@tj tj closed this Jun 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment