[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: Sending binary data to a web service
The answer is clearly "Yes and No". http_url_post_stmf() is used to read post data from a stream file and send it to the server. So it basically does the same as http_url_post(). The difference is that http_url_post() sends post data from the memory whereas http_url_post_stmf() sends the data from a stream file.
If you want to post binary data, you have at least two options to go:
a) You can create a MIME message and send your binary data as an attachment. Depending on the size of the binary data, it might be better to use a stream file to prepare the post data aka the MIME message. That is where http_url_post_stmf() comes into play.
b) You can encode your binary data to Base64 and send the Base64 string as the value of an XML element or (in your case) assign the Base64 string to a Json attribute.
Thomas.
-----Ursprüngliche Nachricht-----
Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von James H. H. Lampert
Gesendet: Freitag, 7. Oktober 2016 00:52
An: HTTPAPI and FTPAPI Projects
Betreff: Re: Sending binary data to a web service
I just noticed http_url_post_stmf(). Can it handle binary?
--
JHHL
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------