![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
09/07/2005, 03:32
|
| | Fecha de Ingreso: febrero-2005
Mensajes: 42
Antigüedad: 20 años Puntos: 0 | |
<html>
<head>
<title>Subir un archivo</title>
</head>
<body>
<?php
session_start();
include "autcp.inc.php";
if (!isset($_POST["submit"])){
?>
<form action="upload.php" method="post" name="miformu" enctype="multipart/form-data">
<input name="archivo" type="file">
<input type="submit" name="submit" value="Subir">
</form>
<?php
}
else{
if($_FILES['archivo']['type'] == "text/plain"){
if($_FILES['archivo']['size'] < 30000){
if(move_uploaded_file($archivo, "archivos/".$_FILES['archivo']['name'])){
echo "Archivo subido con exito";
}
else{
echo "Error al subir el archivo";
}
}
else{
echo "El archivo es mas grande de 30kb";
}
}
else{
echo "El formato del archivo no es valido, solo .txt";
}
}
?>
</body>
</html>
A ver si encontráis el error! :( |