![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
23/04/2004, 18:17
|
![Avatar de syntex](http://static.forosdelweb.com/customavatars/avatar27565_1.gif) | | | Fecha de Ingreso: noviembre-2002 Ubicación: Cataluña
Mensajes: 978
Antigüedad: 22 años, 3 meses Puntos: 4 | |
Problemas con fichero adjunto Ayuda en enviar fichero adjunto
Tengo un problema al enviar un fichero adjunto, bueno el fichero me lo envia perfectamente pero no me deja abrirlo con ningún editor gráfico.
Me podrían decir porque.
$UN_SALTO="\r\n";
$DOS_SALTOS="\r\n\r\n";
$cabecera = "Date: ".date("l j F Y, G:i").$UN_SALTO;
$cabecera .= "MIME-Version: 1.0".$UN_SALTO;
$cabecera .= "From: ".$remitente."<".$remite.">".$UN_SALTO;
$cabecera .= "Return-path: ". $remite.$UN_SALTO;
$cabecera .= "Reply-To: ".$remite.$UN_SALTO;
$cabecera .="X-Mailer: PHP/". phpversion().$UN_SALTO;
$cabecera .= "Content-Type: multipart/mixed;".$UN_SALTO;
$cabecera .= " boundary=$separador".$DOS_SALTOS;
$texto ="--$separador".$UN_SALTO;
# Encabezado parcial
$texto .="Content-Type: text/html; charset=\"ISO-8859-1\"".$UN_SALTO;
$texto .="Content-Transfer-Encoding: 7bit".$DOS_SALTOS;
# Contenido de esta parte del mensaje
$texto .= $KKr;
$adj1 = $UN_SALTO."--$separador".$UN_SALTO;
$adj1 .="Content-Type: image/jpeg; name=\"$Adjunto\"".$UN_SALTO;
$adj1 .="Content-Disposition: inline; filename=\"$Adjunto_name\"".$UN_SALTO;
$adj1 .="Content-Transfer-Encoding: base64".$DOS_SALTOS;
$fp = fopen("$Adjunto", "r");
$buff1 = fread($fp, filesize("$Adjunto"));
fclose($fp);
$adj1 .=chunk_split(base64_encode($buff1));
$mensaje = $texto.$adj1.$adj2.$adj3.$adj4;
if (mail("$AA0","$AA2",$mensaje,$cabecera)){echo"<MET A HTTP-Equiv='Refresh' CONTENT='0;URL=?'>";}
}
__________________
PD: El fichero esta subido al servidor.
__________________ ------------------------------------------------
La paciencia es el rey de la ciencia
------------------------------------------------ |