tags:

views:

42

answers:

2

I need to send image data over network using HttpSendRequest POST request. For this purpose I am creating a string , adding some parameters to string, then I need to add raw image data.

Now I would like to know how can I send the image in post request.

A: 

Just pass the image data to the lpOptional parameter.

If by chance you're trying to mimic the user pressing the submit button, you'll first have to format the body of the HTTP request to conform to application/x-www-form-urlencoded or in this case multipart/form-data content type.

avakar
actually I need to add some string params before image raw data like Content-Disposition: form-data; name=XXXAAAAAAAAAAAAAAAAAASo I need to construct a buffer with these strings and then append image raw data
Alien01
@Alien01, You shouldn't send `Content-Disposition` header in a HTTP request. I don't fully understand what you're trying to do. Perhaps you could edit the question and clarify?
avakar
A: 

If you just need to pass the data into a string and decode it on the server side, look into applying a base64 encoding on it before sending and base64 decoding upon receiving.

utnapistim