I see, thats one solution - and you just reminded me on this hTTP header i keep forgetting too! Thanks for that by the way.
I have to sen dmultiple files and retain some metadata (title, description). Is there some kind of JSON that also lets me work with binary data - in both languages that is? - Ingwie Am 30.09.2014 um 23:15 schrieb Aria Stewart <[email protected]>: > > On Sep 30, 2014, at 5:07 PM, Ingwie Phoenix <[email protected]> wrote: > >> Cool, nice to know! :) >> >> Now, what is if I wanted to save a structure like this and send it to my >> client? >> >> { >> "files": { >> "file.jpg": <data>, >> "name": "My File" >> } >> } > > > JSON is UTF-8, so you're at the mercy of the base64 gods there. > > How about using HTTP metadata? > > res.setHeader('content-disposition', 'attachment; filename=MyFile'); > > Or if it's custom metadata, res.setHeader('x-my-metadata', 'value'); > > If you need to send multiple files, perhaps send a zip or tar of the files. > Browsers have no support for saving multiple files. > > 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/3A6E789F-9DF7-47AB-9E4B-789209CC32BB%40nbtsc.org. > For more options, visit https://groups.google.com/d/optout. -- 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/356F2BC1-2E6D-432A-AC1F-0820FE195C52%40googlemail.com. For more options, visit https://groups.google.com/d/optout.
