note 47970 added to features.file-upload
| From: | info at us3 dot cl | Date: | Tue, 07 Dec 2004 20:27:12 +0000 |
| Subject: | note 47970 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81493@lists.php.net to get a copy of this message | ||
Jorge Schaefer us3 dot cl
como podria yo recibir un archivo word desde un formulario hecho en php.
acontinuacion les envio mi codigo
<?
if (!$HTTP_POST_FILES){
?>
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file:
<input name="userfile" type="file">
<?
}else{
//Estoy recibiendo el formulario, compongo el cuerpo
$cuerpo = "Formulario enviado desde la web\n";
$cuerpo .= "Nombre: ".$nombre."\n";
$cuerpo .= "Apellido: " . $HTTP_POST_VARS["apellido"] . "\n";
$cuerpo .= "Dirección: " . $HTTP_POST_VARS["direccion"] . "\n";
$cuerpo .= "Comuna: " . $HTTP_POST_VARS["comuna"] . "\n";
$cuerpo .= "Email: " . $HTTP_POST_VARS["email"] . "\n";
$cuerpo .= "Archivo: " . $HTTP_POST_FILES['userfile']['size'] .
"\n";
//$cuerpo .= "Anexo: " . $HTTP_POST_VARS["anexo"] . "\n";
//mando el correo...
mail("info@us3.cl","www.us3.cl / contacto", $cuerpo, "From: $nombre
$apellido <$email>");
//mail("info@us3.cl","www.us3.cl / contacto",$cuerpo, "From: $nombre
$apellido <$email>");
//doy las gracias por el envío
echo "<table width=100% border=0 cellspacing=0 cellpadding=4>
<tr>
<td>Gracias ".$nombre." ".$apellido." por haber llenado el
formulario. <br><br>
Se ha enviado correctamente.<br><br>
Pronto uno de nuestros vendedores se contactará con ud.<br><br>
<a href=contacto.php>Volver al formulario</a>
</td>
</tr>
</table>";
}
?>
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47970
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47970&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47970&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47970&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47970&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47970&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47970&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47970&report=yes
Search -- http://master.php.net/manage/user-notes.php