views:

20

answers:

1

In an iPhone app where I use cocoahttpserver and take a sqlite database file from the iPhone and download it with a browser to my PC, when I look at the downloaded file using TextEdit, I see the text (below) at the end of the file. This text has apparently no effect on use of the database file, but I would prefer to not add stuff to the database file at all.

Any ideas where this header info is coming from in cocoahttpserver and how to stop it? Thanks.

------WebKitFormBoundary3RAcT2SVGhGPnoA6
Content-Disposition: form-data; name="submit.x"

26
------WebKitFormBoundary3RAcT2SVGhGPnoA6
Content-Disposition: form-data; name="submit.y"

12
------WebKitFormBoundary001Quvx6Efgaf23y
Content-Disposition: form-data; name="submit.x"

30
------WebKitFormBoundary001Quvx6Efgaf23y
Content-Disposition: form-data; name="submit.y"

12
------WebKitFormBoundaryfHyUUs1p31kBJ3gA
Content-Disposition: form-data; name="submit.x"

52
------WebKitFormBoundaryfHyUUs1p31kBJ3gA
Content-Disposition: form-data; name="submit.y"

9
A: 

After further review (hours), it seems that when the sqlite file is downloaded to a PC, it does not have the headers attached at the end of the file. But when I grab the file from the PC to the iPhone to use to restore the database, THAT is when the header files are added. In the text in the example, this was the result of three separate Restores. So, the problem is not download, it is during a POST.

So, my question remains, and the answer is probably somewhere in HTTPConnection.m, but I cannot find it. Changing the count to 0 in httpResponseForMethod only added more :(

int count = 2;  //number of times the separator shows up at the end of file data

Does anyone know where form-data headers are added on to a posted file?

Thanks.

Don