On Sep 30, 2014, at 4:42 PM, Ingwie Phoenix <[email protected]> wrote:
> The title says it rather well. > > But to elaborate a little: I have a web service that can collect data from a > database, clean it and then send it to a user as a backup. This backup is > supposed to contain binary data, like pictures. But how do I parse such with > nodejs - and what format to use? There is a NodeJS/browser implementation of > BSON, but for PHP you need a compile, which is more or less a downside. > > Does anyone have an idea how to do that, without using base64 within a JSON > object, or is that the only way to go? The web is 8-bit clean! Just send it! In node, that'd be represented as a buffer; if the file is supposed to be saved by the user via a browser, set the content-disposition header to trigger it to download rather than display. PHP strings are just strings of bytes, not characters, so it can just deal with binary data like node does in a buffer. Aria -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/E80B2BE8-91BC-4675-BB03-A9A3EEB82C99%40nbtsc.org. For more options, visit https://groups.google.com/d/optout.
