It could be due to chunking that the body is not yet complete when your
code runs.
On Friday, April 6, 2012 1:57:30 AM UTC+2, Mehdi Avdi wrote:
>
> Hi everyone,
>
> I'm sending the contents of this Flex form (Don't ask why) over to node.
> There is a post paramteter called "photo" which is a base64 encoded image.
>
> Contents of photo get sent over ok. Problem is when I am trying to decode
> the content and write them to a file.
>
> var fs = require("fs");
>
> fs.writeFile("arghhhh.jpg", new Buffer(request.body.photo,
> "base64").toString(), function(err) {});
>
> I've tried toString("binary") as well. But it seems node doesnt decode all
> of the content. It seems it only decodes jpg header info and leaves the
> rest.
>
> Can anyone please help me with this?
>
> Thanks
>
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en