
31/03/2005, 09:08
|
| | Fecha de Ingreso: marzo-2005
Mensajes: 6
Antigüedad: 20 años Puntos: 0 | |
Validación de Upload Hola.
Si alguien me puede ayudar se lo agradecere mucho.
Como puedo validar este script en PHP para que solo se puedan subir determinados archivos (Por ejemplo .jpg) y que me mande un mensaje de error si no corresponde al tipo de archivo, y es posible limitar el tamaño del archivo...?
Gracias....
-----------------------------------------------------------------------
<html>
<head>
<title>Documento sin título</title>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="Top.png" width="747" height="112"></div></td>
</tr>
<tr>
<td><div align="center"><img src="xbeatPanel.png" width="809" height="603">
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file" value="Buscar" />
<input type="submit" name="submit" value="Subir Archivo" />
</form>
<?
$destino = 'Singles';
copy($_FILES['file']['tmp_name'], $destino.'/'.$_FILES['file']['name'])
?>
</div></td>
</tr>
<tr>
<td><div align="center"></div></td>
</tr>
</table>
</body>
</html> |