Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Feature request & patch: append to file objects

It would be nice if we could append to a file. I wanted to work around the fact that httpclient is memory-backed by downloading parts of the file at a time and stitching them back up together, but I wasn't able to do that with the standard API.

If other people need appending, here's a quick hack which adds it on the iphone. I don't expect the patch to be included as-is as it only implements the blob case.


— asked May 26th 2010 by Damien Elmes
  • filesystem
  • iphone

2 Answers

  • Gawd Bless you, Sir!

    I needed to do exactly this, for the exact reasons you said (grabbing a big file without the HTTPClient pooping itself).

    Great patch, and I would highly recommend that we get an official patch (+Android) for this. What do you say, appcelerator dudes - sneak it in for 1.4? Damien's already done most of the iPhone bit for you!


    — answered July 20th 2010 by Andy Smith
  • They did include this patch in the dev code. On Android you can call .write(data, true) to append, so it's now possible on all platforms.

    — answered July 20th 2010 by Damien Elmes
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.