Re: [nodejs] Re: HTTPS request incomplete when piping to a file

2013-05-16 Thread Matt
FWIW that did not fix the problem.


On Wed, May 15, 2013 at 11:17 AM, Matt hel...@gmail.com wrote:


 On Wed, May 15, 2013 at 4:25 AM, greelgorke greelgo...@gmail.com wrote:

 are you sure it's the end of the file? not the start?


 Yeah - the files always start with the correct %PDF bytes. It's just
 missing the index at the end of the file.

 I'll try your suggestion anyway, and see if it makes any difference.

 Matt.


-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: HTTPS request incomplete when piping to a file

2013-05-15 Thread greelgorke
are you sure it's the end of the file? not the start? you're on 0.8.X, so 
you might just loose some packages at start, because the stream is already 
going on. a bug, that is fixed in 0.10. have you tried this:

var ws = fs.createWriteStream(filename, {encoding: 'binary'});
r.pipe(ws);
ws.on('close', function () {
   // parse the PDF
});
r.on('error', function (err) { console.log(err) });
r.on('end', function () { console.log('end') });
r.on('close', function () { console.log('close') });


Am Montag, 13. Mai 2013 20:53:06 UTC+2 schrieb Matt Sergeant:

 On Mon, May 13, 2013 at 2:45 PM, mscdex msc...@gmail.com javascript:wrote:

 Don't set the encoding here if you're piping. Just do: `var ws =
 fs.createWriteStream(filename);`


 See the comment above that line - I've tried both ways. Still occurs.


-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: HTTPS request incomplete when piping to a file

2013-05-15 Thread Matt
On Wed, May 15, 2013 at 4:25 AM, greelgorke greelgo...@gmail.com wrote:

 are you sure it's the end of the file? not the start?


Yeah - the files always start with the correct %PDF bytes. It's just
missing the index at the end of the file.

I'll try your suggestion anyway, and see if it makes any difference.

Matt.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: HTTPS request incomplete when piping to a file

2013-05-13 Thread Matt
On Mon, May 13, 2013 at 2:45 PM, mscdex msc...@gmail.com wrote:

 Don't set the encoding here if you're piping. Just do: `var ws =
 fs.createWriteStream(filename);`


See the comment above that line - I've tried both ways. Still occurs.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups nodejs group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.