Ver Mensaje Individual
  #13 (permalink)  
Antiguo 14/09/2008, 23:15
Avatar de Ronruby
Ronruby
 
Fecha de Ingreso: julio-2008
Ubicación: 18°30'N, 69°59'W
Mensajes: 4.879
Antigüedad: 15 años, 9 meses
Puntos: 416
Respuesta: Saber la ruta del archivo

:P Si, pero al parecer el IE7 y el Chrome se saltan ese tema de seguridad.

Puedes usar el codigo que te puse ahi arriba y si quieres cambiarlo para pasar ese valor por un campo oculto.
El problema seria cuando los usuarios esten en Firefox. Entonces si tendrian que buscar el archivo de nuevo.

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<script language="javascript">

	function campoFile() {
		document.formulario.ruta.value = document.formulario.file.value;
	}

</script>
</head>

<body>
<form action="" method="post" enctype="multipart/form-data" name="formulario" id="form1">
  <input type="file" onChange="campoFile();" name="file" />
  <input type="hidden" name="ruta" value="" />
</form>
</body>
</html> 
Ya con un IF confirmas si el valor esta, si esta pues le haces un echo y ya.