Foros del Web » Programando para Internet » PHP »

Me podeis ayudar

Estas en el tema de Me podeis ayudar en el foro de PHP en Foros del Web. Me he bajao este codigo pero no me funciona cuando va a enviar el archivo me pide otra pagina uploadmulti.php, me podriais echar una mano, ...
  #1 (permalink)  
Antiguo 06/05/2003, 10:54
 
Fecha de Ingreso: junio-2002
Mensajes: 77
Antigüedad: 21 años, 9 meses
Puntos: 0
Me podeis ayudar

Me he bajao este codigo pero no me funciona cuando va a enviar el archivo me pide otra pagina uploadmulti.php, me podriais echar una mano, muchas gracias


<?

$abpath = "C:\Archivos de programa\EasyPHP\www\ftp\archivos"; //Absolute path donde se colocaran los archivos. No trailing slash
$sizelim = "no"; //Quieres un limite en tamano de los archivos
$size = "2500000"; //Limite en tamano en kb
$number_of_uploads = 5; //Numero de archivos a subir simultaneamente

if ($_REQUEST['submitted']){ // Begin processing portion of script

//all image types to upload
$cert1 = "image/pjpeg"; //Jpeg type 1
$cert2 = "image/jpeg"; //Jpeg type 2
$cert3 = "image/gif"; //Gif type
$cert4 = "image/ief"; //Ief type
$cert5 = "image/png"; //Png type
$cert6 = "image/tiff"; //Tiff type
$cert7 = "image/bmp"; //Bmp Type
$cert8 = "image/vnd.wap.wbmp"; //Wbmp type
$cert9 = "image/x-cmu-raster"; //Ras type
$cert10 = "image/x-x-portable-anymap"; //Pnm type
$cert11 = "image/x-portable-bitmap"; //Pbm type
$cert12 = "image/x-portable-graymap"; //Pgm type
$cert13 = "image/x-portable-pixmap"; //Ppm type
$cert14 = "image/x-rgb"; //Rgb type
$cert15 = "image/x-xbitmap"; //Xbm type
$cert16 = "image/x-xpixmap"; //Xpm type
$cert17 = "image/x-xwindowdump"; //Xwd type

$log = "";

for ($i=0; $i<$number_of_uploads; $i++) {

//checks if file exists
if ($img_name[$i] == "") {
$log .= "No file selected for upload $i<br>";
}

if ($img_name[$i] != "") {
//checks if file exists
if (file_exists("$abpath/$img_name[$i]")) {
$log .= "File $i already existed<br>";
} else {

//checks if files to big
if (($sizelim == "yes") && ($img_size[$i] > $size)) {
$log .= "File $i was too big<br>";
} else {


//Checks if file is an image
if (($img_type[$i] == $cert1) or ($img_type[$i] == $cert2) or ($img_type[$i] == $cert3) or ($img_type[$i] == $cert4) or ($img_type[$i] == $cert5) or ($img_type[$i] == $cert6) or ($img_type[$i] == $cert7) or ($img_type[$i] == $cert8) or ($img_type[$i] == $cert9) or ($img_type[$i] == $cert10) or ($img_type[$i] == $cert11) or ($img_type[$i] == $cert12) or ($img_type[$i] == $cert13) or ($img_type[$i] == $cert14) or ($img_type[$i] == $cert15) or ($img_type[$i] == $cert16) or ($img_type[$i] == $cert17)) {
@copy($img[$i], "$abpath/$img_name[$i]") or $log .= "Couldn't copy image 1 to server<br>";
if (file_exists("$abpath/$img_name[$i]")) {
$log .= "File $i was uploaded<br>";
}
} else {
$log .= "File $i is not an image<br>";
}
}
}
}


}

?>

<html>
<head>
<title>Image Report</title>
</head>
<body>
<p>Log:<br>
<?

echo "$log";

?>
</p>
<body>
</html>
<?
exit;
} // End processing portion of script
?>

<html>
<head>
<title>Upload Image</title>
</head>
<body>
<form method=POST action=uploadmulti.php enctype=multipart/form-data>
<p>Files to upload:<br>
<?

for ($j=0; $j<$number_of_uploads; $j++) {
?>
<input type=file name=img[] size=30><br>
<?
}
?>
<input type="hidden" name="submitted" value="true">
<input type="submit" name="submit" value="Upload">
</form>
</body>
</html>
  #2 (permalink)  
Antiguo 06/05/2003, 12:53
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 2 meses
Puntos: 129
Parece ser q ese código q tienes al principio .. entre <? y ?> es el famoso uploadmulti.php que te pide ... Así que guardalo como un archivo con ese nombre .. y el formulario en otra parte (otro archivo)..

Por lo demas .. fijate bien de donde "cortas y pegas" el código y si tiene autor ese código .. preguntale al autor.

Un saludo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.
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:58.