![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
27/12/2011, 13:10
|
| | Fecha de Ingreso: mayo-2008
Mensajes: 11
Antigüedad: 16 años, 8 meses Puntos: 0 | |
Subir Imagen desde un Servidor con CURL PHP Hola!
Queria saber como hacer para enviar una imagen desde una URL o desde mi propio servidor, hacia otro servidor.
Tengo este ejemplo, pero no funicona:
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url_foto);
curl_setopt($ch, CURLOPT_POST, true);
$postdata = array();
$postdata ['file'] = "@http://www.google.com.ar/logo.gif";
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$result = curl_exec($ch);
Gracias
Saludos |