[OSM-dev] Problem sending GPX file from mobile phone to server API

matgra-3 at student.ltu.se matgra-3 at student.ltu.se
Fri Aug 28 15:19:00 BST 2009


Hi

I´m developing a J2ME client for mobile phones, that should be a tool for 
building up openstreetmap. My client is working with openstreetmap server API.
 
When i try to upload my GPX file to the server through multipart/form-data HTTP 
message it works fine if i send few nodes, where the content-length header in 
http request is only a few bytes long(around 1000 bytes). But if i try to 
upload a GPX file that contains more nodes i first get "(411) length required" 
respond from the server when i try to upload it. If i try to upload even more 
nodes i get "(500) internal server error" and last i get "(502) bad gateway" if 
i upload a GPX file with more nodes.
 
Is there some work around to make the phone send whole GPX file? 

Now it seems that the content-length header is filter out after i reach some 
value of bytes length of the message i try to upload to openstreetmap server. 
When the Content-Length is over around 1000 bytes the phone automatically 
change to transfering in "Transfer-Encoding: chunked", which openstreetmap 
server does not seem to be able to handle. With chunked transfer the phone 
sends the GPX file in several series. 

A chunked message body contains a series of chunks, followed by a line with "0" 
(zero), followed by optional footers (just like headers), and a blank line. 
Each chunk consists of two parts: 

*a line with the size of the chunk data, in hex, possibly followed by a 
semicolon and extra parameters you can ignore (none are currently standard), 
and ending with CRLF. 

*the data itself, followed by CRLF.

/Mattias





More information about the dev mailing list