Foros del Web » Programando para Internet » PHP »

upload

Estas en el tema de upload en el foro de PHP en Foros del Web. Holitas amigos de FWD tengo un codigo que cuando lo subo al servidor me arroja este mensaje Fatal error: Call to undefined function mime_content_type() in ...
  #1 (permalink)  
Antiguo 24/07/2007, 03:39
 
Fecha de Ingreso: julio-2007
Mensajes: 3
Antigüedad: 16 años, 8 meses
Puntos: 0
upload

Holitas amigos de FWD
tengo un codigo que cuando lo subo al servidor me arroja este mensaje
Fatal error: Call to undefined function mime_content_type() in /home/los/public_html/imagehosting.php on line 11

lo he traducido y buscado en san google pero no logro hayar la respuesta
agradeceria mucho alguna orientacion al respecto

Gracias

imagehosting.php

<?php
$varrand = substr(md5(uniqid(rand())),0,10);
$varallw = array("image/bmp","image/gif","image/jpeg","image/pjpeg","image/png","image/x-png");
$varpath = "3w/laweb/com/imagehosting.php?image=";
$varstat = "";

if ($_POST["action"] == "upload") {
if (is_uploaded_file($_FILES["imagen"]["tmp_name"])) {
$varname = $_FILES["imagen"]["name"];
$vartemp = $_FILES["imagen"]["tmp_name"];
$vartype = mime_content_type($vartemp);

if (in_array($vartype, $varallw) && $varname != "") {
$arrname = explode(".", $varname);
$varname = $varrand.".".$arrname[1];
if (copy($vartemp, "tmp/".$varname)) {
$varpath = $varpath.$varname;
$varstat = "ok";
} else {
$varstat = "Error al subir el archivo";
}
} else {
$varstat = "Archivo no valido";
}
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Datos personales</title>
<link href="cssupload.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="413" height="40" class="titulo"></td>
</tr>
<tr>
<td class="text">Sube tu foto:</td>
</tr>
<tr>
<form action="imagehosting.php" method="post" enctype="multipart/form-data">
<td height="50" valign="top" class="text">
<input name="imagen" type="file" class="casilla" id="imagen" size="35" />
<input name="enviar" type="submit" class="boton" id="enviar" value="Upload Image" />
<input name="action" type="hidden" value="upload" /> </td>
</form>
</tr>
<?php if ($varstat == "ok") { ?>
<tr>
<td class="textinf"><strong>Confirmaci&oacute;n:</strong><br>
Archivo publicado satisfactoriamente. Puedes utilizar las siguientes opciones para enlazarlo:<br>
<strong>Enlace HTML:</strong> <br>
<input name='txt1' type='text' value='<a href="<?php echo $varpath; ?>"><img src="<?php echo $varpath; ?>" border="0" /></a>' size='60'>
<br>
<strong>Enlace Directo: </strong><br>
<input name='txt2' type='text' value='<?php echo $varpath; ?>' size='60'></td>
</tr>
<?php } else { ?>
<?php if ($varstat != "") { ?>
<tr>
<td class="textinf"><strong>Error:</strong><br>
<?php echo $varstat; ?>&nbsp;</td>
</tr>
<?php } ?>
<?php } ?>
</table>
<?php if ($varstat == "ok") { ?>
<p align="center"><img src="tmp/<?php echo $varname; ?>"></p>
<?php } ?>
<?php if ($_GET['image'] != "") { ?>
<p align="center"><img src="tmp/<?php echo $_GET['image']; ?>"></p>
<?php } ?>
</body>
</html>
  #2 (permalink)  
Antiguo 24/07/2007, 05:45
 
Fecha de Ingreso: julio-2003
Ubicación: Colombia
Mensajes: 591
Antigüedad: 20 años, 9 meses
Puntos: 7
Re: upload

Joche, mira el phpinfo() de tu servidor.

Muy probablemente se deba a que la extensión php_mime_magic, esté deshabilitada.

Chaop!
__________________
Visita www.legionlandrover.com
  #3 (permalink)  
Antiguo 27/07/2007, 03:16
 
Fecha de Ingreso: julio-2007
Mensajes: 3
Antigüedad: 16 años, 8 meses
Puntos: 0
Re: upload

Gracias por el dato luchope
y disculpa la demora
pero ahora me pongo a revisar sobre esa extension

saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:29.