tags:

views:

23

answers:

1

Hi Everyone,

I want to upload images to some server using multipart post request. I am using PHP/cURL to send soap request envelopes

Any help would be very appreciated.

Amjad

A: 

I am a bit unsure what excatly you are trying to do. If you want to include images in a SOAP request, you should send the binary content of that image as base64 encoded string (using PHPs base64_encode function).

If you could update your answer with more details what you are trying to achieve and maybe post some code, we could provide you with better answers.

Max
Yes, I want to send an image with SOAP Request but target server is not supporting base64 method. Instead, I have to use a multi part post request just as we send through a simple html form with some target URL. Or may be I need some more better way but not finding one yet.
Amjad Shaick
@Amjad Shaick - hm, but attachments in multipart messages are normally base64 encoded, too. What do you mean that the target server does not support base64 encoding?
Max
I got this instruction from service provider: NOTE: images are specified in binary (not Base64) format. Also, the Content-Disposition header uses “form-data; name="filename"; filename="format (not “attachment; filename =’’ format).
Amjad Shaick
@Amjad Shaick Hm, did you try to send the raw binary content of an image along? So, just the content you get when using file_get_contents('your_img.png'); ?
Max
Not yet.. Seems good idea so I will give it a try !
Amjad Shaick
Can we achieve this through PHP/cURL ?
Amjad Shaick