Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/05/2013, 08:58
mir_martin9
 
Fecha de Ingreso: septiembre-2010
Mensajes: 82
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: Incorporar a formulario un de datos subir una imagen

si pero yo hize un formulario aparte de subida, del archivo pero nose como incorporarlo a ese que puse ahi aca dejo el de subida,
Cita:
<html>
<head>

</head>

<body>
<form name="frmCV" method="post" enctype="multipart/form-data">
<table align='center' border=0 cellspacing=0>
<tr>
<td align='center'>
<h2>Subida archivos</h2>
</td>
</tr>
<tr>
<td align='right'>
<?php

$timestring = strval(date("Y").date("m").date("d").date("H").dat e("i").date("s"));
if(isset($_POST["submit"])){


if($_FILES["file"]["name"]){
$filenamenoext = pathinfo($_FILES['file']['name'], PATHINFO_FILENAME);
$ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
$tipo = $_FILES["file"]['type'];
$size = $_FILES["file"]['size'];
echo $size;
if($tipo == "image/jpeg" || $tipo == "text/plain"){
if($size < 100000 ){
$to = "descargas/".$filenamenoext.' - '.$timestring.'.'.$ext;
move_uploaded_file($_FILES['file']['tmp_name'], $to);
echo "UPLOADED";
}else {
echo "El archivo debe ser menor a 100KB";
}
}else {
echo "Archivo no valido";
}


}
}

?>
<br>
Imagen: <input type="file" name="file"><br>
<input type="submit" value="Upload" name="submit"><br>



</td>
</tr>
</table>
</form>



</body>
</html>