| 
	
 | 
 Posted by grande news on 05/08/06 01:30 
Hello, 
 
    I am trying to send a bunch of data via a single POST message, from a 
wireless device to a PHP script on my server.  Some of this data is 
base64_encoded binary image data.  Basically, I want to send a series of 
small icons, and each has a width, height, and the pixel data. So I am 
sending the following strings via a Socket connection: 
 
"POST http://www.mydomain.com/processicons.php HTTP/1.0\n" 
"From: me@mydomain.com\n" 
"User-Agent: HTTPTool/1.0\n"; 
"Content-Type: application/x-www-form-urlencoded\n" 
"width=32&height=32d&data=" 
 
following this I send the base64 encoded data for the image.  Then "\n\n" to 
end the POST. 
 
This works for a single image, but if I want to send multiple images in the 
same post, it doesn't work.  What I tried is just incrementing my variable 
names and adding for example "&width2=32&height2=32&data2=blahblahblah" over 
and over again for all the images I want to send, eventually followed by the 
'\n\n'.  However, in my php script I tried printing out all of the _POST 
variables it receives, and it seems like everything after that first 'data' 
variable is just being lost, or maybe included in the image data?  I don't 
know. 
 
I thought that the '&' symbol should tell the script that a new variable has 
come along.  And the base64encode doesn't use that symbol, I don't think. 
Maybe it does and that it my problem? 
 
Thanks for any suggestions 
 
Bint
 
  
Navigation:
[Reply to this message] 
 |