Hey chicos. Ya se que ya me teneis que odiar... pero tengo un nuevo error en:
El error es:
Warning: copy(images/NOMBREIMAGEN) [function.copy]: failed to open stream: No such file or directory in /home/a4865782/public_html/upload/index.php on line 15
La linea 15:
Alguno me ayuda?
El código de subida es de un blog, lo demás es mio (La inserccion en la bd, basicamente) Si encontrais algún otro error, no dudeis en decirmelo ;)
<?php
$status = "";
if ($_POST["action"] == "upload") {
// obtenemos los datos del archivo
$tamano = $_FILES["archivo"]['size'];
$tipo = $_FILES["archivo"]['type'];
$archivo = $_FILES["archivo"]['name'];
$prefijo = substr(md5(uniqid(rand())),0,6);
if ($archivo != "") {
// guardamos el archivo a la carpeta files
$destino = "images/".$prefijo."_".$archivo;
$nombre = "".$prefijo."_".$archivo."";
if (copy($_FILES['archivo']['tmp_name'],$destino)) {
$status = "File uploaded: <b>".$nombre."</b>";
$url = "http://btimages.net84.net/images/$nombre";
include ('config.php');
$connect= mysql_connect("$host","$user", "$password");
mysql_select_db("$database",$connect);
mysql_query ("INSERT INTO imagenes (`url`, `descripcion`) VALUES ('$url', '$_POST[descripcion]')") or die ('There were problems...');
echo "File has been uploaded. Now u can <a href='index.php'>still uploading</a> files.";
} else {
$status = "Error";
}
} else {
$status = "Error";
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Upload of images</title>
<link href="estilo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="413" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="413" height="40" class="titulo">Uploader</td>
</tr>
<tr>
<td class="text">Please, choose the file you want to upload:</td>
</tr>
<tr>
<form action="index.php" method="post" enctype="multipart/form-data">
<td class="text">
<input name="archivo" type="file" class="casilla" id="archivo" size="35" />
<p>Description:<br/> <textarea name="descripcion" style="border: 1 px solid dotted ; width: 350px ; height:400px" maxlength="150"></textarea></p>
<input type="reset" value="Reset all" name="Reset" />
<input name="action" type="hidden" value="upload" /> <input name="enviar" type="submit" class="boton" id="enviar" value="Upload File" /></td>
</form>
</tr>
<tr>
<td class="text" style="color:#990000"><?php echo $status; ?></td>
</tr>
<tr>
</tr>
</table>
</body>
</html>El error es:
Warning: copy(images/NOMBREIMAGEN) [function.copy]: failed to open stream: No such file or directory in /home/a4865782/public_html/upload/index.php on line 15
La linea 15:
if (copy($_FILES['archivo']['tmp_name'],$destino)) {Alguno me ayuda?
El código de subida es de un blog, lo demás es mio (La inserccion en la bd, basicamente) Si encontrais algún otro error, no dudeis en decirmelo ;)