| Ver tema anterior :: Ver siguiente tema |
| Autor |
Mensaje |
suko Yo soy el foro

Registrado: 14 Sep 2004
Mensajes: 809
Ubicación: España.
|
Publicado: Jue Oct 21, 2004 7:15 pm Título del mensaje: no me rula... |
|
|
oie hay que modificar algunos paremetros de l script???
porque ami tal y como puso malder no me funciona
| malder escribió: |
Hola external, aqui tienes el gran codigo upload jeje... no lo vendas eh xD
index.php---.
| Código: |
<html>
<head>
<title>sube tus graficos al foro ojo no sobreescribas los que ya estan www.foroz.org</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<br><br><br><br><br>
<form enctype="multipart/form-data" action="<?PHP echo $PHP_SELF ?>"
method="post">
<div align="left">
<input type="hidden" name="MAX_FILE_SIZE" value="200000000">
Enviar un archivo:
<input name="userfile" type="file">
<input type="submit" name="submit" value="Enviar">
</div>
</form>
<?PHP
// copy to this directory
$dir="./";
// copy the file to the server
if (isset($submit)){
if (!is_uploaded_file ($userfile)){
echo "<b>$userfile_name</b> ERROR DE ARCHIVO !!";
}
// check whether it has been uploaded
if (is_uploaded_file ($userfile)){
move_uploaded_file($userfile,$dir.$userfile_name) ;}
echo "Archivo correctamente copiado !! <a href=\"$userfile_name\" target=\"_blank\" >abrirlo</a>";
}
?>
<br>
<br>
<?
//definimos el path de acceso
$path="./";
//instanciamos el objeto
$dir=dir($path);
//Mostramos las informaciones
echo "Directorio ".$dir->path.":<br><br>";
while ($elemento = $dir->read())
{
echo $elemento."<br>";
}
//Cerramos el directorio
$dir->close();
?></body>
</html>
|
Salu2  |
_________________ Si no intentas grandes cosas, nunca las conseguiras.
[url=http://www.mundowarezweb.com]
Entra a MuNDowAREzwEB.CoM / Elinks / Torrents / Emule / Bittorrent[/url] |
|
| Volver arriba |
|
 |
suko Yo soy el foro

Registrado: 14 Sep 2004
Mensajes: 809
Ubicación: España.
|
Publicado: Jue Oct 21, 2004 7:22 pm Título del mensaje: |
|
|
sorry lo probe en el local y no me funcionaba lo meti en lycos y ya va de fabula!!
MUY BUENO EL CODIGO! SIRVE MUCHO!
Salu2  _________________ Si no intentas grandes cosas, nunca las conseguiras.
[url=http://www.mundowarezweb.com]
Entra a MuNDowAREzwEB.CoM / Elinks / Torrents / Emule / Bittorrent[/url] |
|
| Volver arriba |
|
 |
AmyKaioh Forero


Registrado: 25 Abr 2004
Mensajes: 83
Ubicación: stgo
|
Publicado: Mar Oct 26, 2004 5:07 am Título del mensaje: |
|
|
llegue un poco tarde..
pero este script uso yo pa subir archivos a mi host.. onda la karpeta compartida..
| Código: |
<?
$extlimit = "no"; //limite de extension
$limitedext = array(".gif",".jpg",".png",".jpeg",".mp3",".zip"); //extenciones.
$sizelimit = "no"; //limite de tamaño
$sizebytes = "9000000"; //tamaño limite en bytes
$dl = "http://www.tupagina.com/upload/filez"; //url de los archivos subidos
$absolute_path = "filez"; // carpeta dode se guardaran los archivos subidos
$websiteurl = "http://www.tupagina.com/upload/index.php"; //url de la web
$websitename = "Inicio"; // title..
if (!isset($action)) {
$action = "";
}
switch($action) {
default:
echo"
<html>
<head>
<title>Subir y deskargar archivos</title>
</head>
<body>
<a href=$PHP_SELF?action=upload>Subir Archivos</a>
<a href=$PHP_SELF?action=download>Bajar Archivos</a>
<a href=$websiteurl>Volver al $websitename</a>
<br><br>
</body>
</html>";
break;
case "download":
echo "
<html>
<head>
<title>Lista de Archivos</title>
</head>
<body><a href=$PHP_SELF?action=upload>Subir Archivos</a> <a href=$websiteurl>Volver al $websitename</a><br><br>";
$list = "<table width=350 border=1 bordercolor=#000000 style=\"border-collapse: collapse\">";
$list .= "<tr><td width=350><center><b>Deskarga de archivos</b></center></td></tr>";
$dir = opendir($absolute_path);
while($file = readdir($dir)) {
if (($file != "..") and ($file != ".")) {
$list .= "<tr><td width=350><a href='$dl/$file'>$file</a> - $file_size</center></td></tr>";
}
}
$list .= "</table>";
echo $list;
echo"
<br><br>
</body>
</html>";
break;
case "upload":
echo"
<html>
<head>
<title>Subir Archivos</title>
</head>
<body>
<form method=POST action=$PHP_SELF?action=doupload enctype=multipart/form-data>
<p>Archivo a subir:<br>
<input type=file name=file size=30>
<p><button name=submit type=submit>
Subir
</button>
</form>
<br><br>
</body>
</html>";
break;
//File Upload
case "doupload":
$dir = "dir";
if ($file != "") {
if (file_exists("$absolute_path/$file_name")) {
die("File already exists");
}
if (($sizelimit == "yes") && ($file_size > $sizebytes)) {
die("El Archivo es muy grande. Debe ser de $sizebytes bytes o menos.");
}
$ext = strrchr($file_name,'.');
if (($extlimit == "yes") && (!in_array($ext,$limitedext))) {
die("La extencion del archivo no es korrecta.");
}
@copy($file, "$absolute_path/$file_name") or die("El archivo no se puede subir..");
} else {
die("Eskoge un arcihvo..xD");
}
echo "
<html>
<head>
<title>Archivo Subido..</title>
</head>
<body>";
echo $file_name." a sido Subido";
echo "<br>
<a href=$PHP_SELF?action=upload>Subir otro Archivo</a>
<a href=$PHP_SELF?action=download>Deskargar archivos</a>
</body>
</html>";
break;
}
?> |
tienes ke tener al lado de este script una carpeta con el nombre filez pero le puedes poner cualkier nombre a la karpeta .. eso lo kambias en los parametros ke hay en el archivo..
y eso ..
es super simple la cosa.. _________________ Ya me da hasta lata tener una firma decente.. |
|
| Volver arriba |
|
 |
|
|
|