Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/03/2008, 16:03
Avatar de juanleonardo
juanleonardo
 
Fecha de Ingreso: agosto-2007
Mensajes: 382
Antigüedad: 16 años, 8 meses
Puntos: 0
Problema con copy

Hola amigos, les comento que estaba haciendo pruevas de la funcion copy, y me salto el siguiente problema que espero ustedes me ayuden a resolver.
Tengo un formulario el cual es para elegir una imagen:
introImg5.php

Cita:
<form action="ejCopy.php" method="post" enctype="multipart/form-data">
Imagen: <input type="file" name="imagen" />
<input type="submit" name="enviar" />
y este es ejCopy.php
Cita:
<?php
$img=$_FILES['imagen']['tmp_name'];
echo $img;
?>
<!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>
</head>
<body>
<?php
$file = $img;
$newfile = 'movido/'.$img;

if (!copy($file, $newfile)) {
echo "failed to copy $file...\n";
}
?>
</body>
</html>
cuando selecciono una imagen por ejemplo del escritorio, me da un error de copiado.
Gracias por la ayuda