Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/09/2012, 10:24
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 14 años, 4 meses
Puntos: 6
problema con formulario para subir archivo a servidor

hola amigos tengo el sigguiente problema con formulario para subir archivo a servidor

me sale este warning
Warning: copy(01.JPG) [function.copy]: failed to open stream: No such file or directory in C:\websites\up\upload_file.php on line 4
Could not copy file!

este es mi codigo

Código HTML:
Ver original
  1. <title>Subir Archivos</title>
  2. </head>
  3. <h3>Subir Archivo:</h3>
  4. Seleccione el Archivo: <br />
  5. <form action="upload_file.php" method="post"
  6.                        enctype="multipart/form-data">
  7. <input type="file" name="file" size="50" />
  8. <br />
  9. <input type="submit" value="Subir Archivo" />
  10. </form>
  11. </body>
  12. </html>

upload_file.php


<?php
if( $_FILES['file']['name'] != "" )
{
copy( $_FILES['file']['name'], "up" ) or
die( "Could not copy file!");
}
else
{
die("No file specified!");
}
?>
<html>
<head>
<title>Uploading Complete</title>
</head>
<body>
<h2>Uploaded File Info:</h2>
<ul>
<li>Sent file: <?php echo $_FILES['file']['name']; ?>
<li>File size: <?php echo $_FILES['file']['size']; ?> bytes
<li>File type: <?php echo $_FILES['file']['type']; ?>
</ul>
</body>
</html>

que estoy haceindo mal?