Ver Mensaje Individual
  #7 (permalink)  
Antiguo 27/10/2015, 10:35
Avatar de gogupe
gogupe
 
Fecha de Ingreso: octubre-2006
Ubicación: Mallorca
Mensajes: 897
Antigüedad: 20 años
Puntos: 32
Respuesta: Enviar archivo por POST a una URL

Vale, he cambiado a otro hosting que tengo y ahora no me da ningún mensaje, pero es que tampoco me dice nada, la pantalla en blanco, el código que uso es muy simple:

Código PHP:
<?php
$ch 
= curl_init();
$file= "/overseasSendProperty.json";
$post = array('file' => '@'.$file);

curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, false);
curl_setopt($ch, CURLOPT_URL, 'https://adfapi.adftest.rightmove.com/v1/property/overseassendpropertydetails ');

curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

$r = curl_exec($ch);
print_r($r);
?>
Al final hay un print_r, al menos debería retornar algún dato... estoy haciendo algo mal?

Gracias.
__________________
Somos una serie de acontecimiento que puede venir al caso en un momento dado.