Hello,

on 02/21/2006 03:40 PM Dirk Vanden Boer said the following:
> I have a C++ application that posts binary data to a php script that I 
> created using libcurl. Everything works fine except when my binary data 
> happens to start with the '&' symbol. In that case I can't read the http 
> post data (isset returns false).
> 
> The post argument then looks like data=&ÑÚA
> Reading the post is done like this:
> if (isset($_POST['data'])
> Is there a way to fix this problem?

The problem is that you are misleading PHP telling that you are posting
form data. You need to correct the request Content-Type. It must not be
application/x-www-form-urlencoded nor multipart/form-data . I think you
can use anything except those types, like for instance
application/octet-stream which is the default for binary files.

I don't know how can you hack libcurl to make it use the right request
content-type. It is probably easy. If you are not able to do it, you may
want to try this PHP HTTP client class . It can send custom POST requests.

http://www.phpclasses.org/httpclient

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to