Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/06/2010, 16:14
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 10 meses
Puntos: 1517
Respuesta: Enviar 2 imágenes con CURL

Mira este ejemplo. El truco está en el @ indicado en el texto
Código PHP:
Ver original
  1. <?php
  2. $ch = curl_init();
  3. curl_setopt($ch, CURLOPT_URL, "http://example.com/send_file.php");
  4. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  5. curl_setopt($ch, CURLOPT_POST, true);
  6. // lo mismo que <input type="file" name="nombre_del_input" />
  7. $post = array(
  8.     "nombre_del_input"=>"@C:/directorio/hacia/el/archivo.jpg",
  9. );
  10. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  11. $response = curl_exec($ch);
  12. echo $response;
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos