Skip to content

Instantly share code, notes, and snippets.

@nicolapiz
Created March 2, 2014 18:07
Show Gist options
  • Save nicolapiz/9310871 to your computer and use it in GitHub Desktop.
Save nicolapiz/9310871 to your computer and use it in GitHub Desktop.
html que contiene el formulario para poder subir un fichero. Llamara a upload.php para que suba el fichero
<!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=utf-8" />
<title>Ejercicio 6</title>
<script language="javascript" type="text/javascript">
function check(){
if(document.getElementById("file").value!=""){
return true;
}else{
alert("Debes seleccionar un fichero");
return false
}
}
</script>
</head>
<form action="upload.php" method="post" enctype="multipart/form-data" onsubmit="return check();">
<label >Subir foto</label><input type="file" name="file" id="file"/><br />
<input type="submit" value="Enviar" onclick="check();"/>
</form>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment