http upload of image.bin

i am trying to download image.bin of size 623k into my digi board flash sector using http .In naftapp.c image.bin is written as 128k blocks i want to write as a single block so crash does not happen if firmware download is interrupted in between.Also how to send
size of image.bin to server before downloading can anybody help me on this.