Foros del Web » Programando para Internet » PHP »

Subir Archivo Por Url

Estas en el tema de Subir Archivo Por Url en el foro de PHP en Foros del Web. Buenas Noches, Les Expongo Mi Problema, Primero No Se La Gran Cosa De Php Voy Aprendiendo, Segundo Quiero Subir Un Archivo Por Url A Mi ...
  #1 (permalink)  
Antiguo 15/08/2010, 20:55
 
Fecha de Ingreso: julio-2009
Mensajes: 53
Antigüedad: 14 años, 8 meses
Puntos: 0
Subir Archivo Por Url

Buenas Noches, Les Expongo Mi Problema, Primero No Se La Gran Cosa De Php Voy Aprendiendo, Segundo Quiero Subir Un Archivo Por Url A Mi Hosting (Para Eso Esta Diseñado El Script) Logra Subir Solo El Archivo Pero Con Peso De "0"Kb. No Entiendo Por Que Espero Me Ayuden Les Dejo Aqui En Resumen El Codigo.


Y El Link A Subir Es ww w.OcultamosPorSpam/ates/atesregular215_installer.exe

Index.php
Código PHP:
<? 
ignore_user_abort
();
include(
"configuration.php");
include(
"conf-htmlheader.htm");
include(
"axrotate.php");

$trheute=$heute+1;
if(
$trheute>$maximum_free_downloads) { echo"You 
already used your <b>$maximum_free_downloads</b> free 
files for today!<br><br>Think about donating an 
account!<br><br>"
;include("conf-htmlfooter.htm");die; }
else {

if(
$link=="") {
echo
"Ingresa Tu Link:
<form method=post onsubmit=\"this.x.value='ESPERA...';this.x.disabled=true\" ><input style=background:#dddddd; type=text 
name=link 
size=50>
<input type=submit name=x value=GET4FREE></form><br><br>"
;

}
else {




$filename"atesregular215_installer.exe";
if(
$tott==1) { } else { 

$link="$link";
if(
$filename=="") { echo"Link crippled. Please check!"; }
if(
eregi(".php",$filename)) { $filename="$filename.txt"; }
if(
file_exists("files/files$tiam/$filename")) { } else {
echo
"Downloading $filename<br><span id=info></span><br>";
$begtime=time();$filex=fopen("$link""r");
$clog=fopen("files/files$tiam/$filename","a");
if (!
$filex) {   echo "<p>No Se Puede Subir El Archivo Intentalo De Nuevo!<br><br>";die; }
while (!
feof ($filex)) {$line fread ($filex,1024);fwrite($clog,"$line");
$kbf=$kbf+1$kbx=$kbx+1;if($kbx==100) {
$kbx=0;$nowtime=time();$dura=$nowtime-$begtime+1;$kbs=round($kbf/$dura);
echo
"<script>document.getElementById(\"info\").innerHTML = '<b>$kbf KB @ $kbs KB/s</b>';</script>";}}
fclose($filex);
$tiamx=$tiam;
fclose($clog);mkdir("tmp/$_SERVER[REMOTE_ADDR].$filename",0777);}
$tiam=time();$tiam=substr($tiam,0,7);$tiam=md5($tiam);
rename("files/files$tiamx","files/files$tiam");
echo
"Fetched <b><a href=\"files/files$tiam/$filename\">$filename</a></b>.
Click <b><a href=\"files/files$tiam/$filename\">here</a></b> to download it.
<br><br>"
;
}

 }
}
include(
"conf-htmlfooter.htm");
configuration.php

Código PHP:
<?



$show_file_list
="yes"# Mostrar Archivos Si O No?

$maximum_free_downloads="3";
$maximum_space_usage_in_mb="1000"

$design="124"


$design=rand(100,124); # random design




import_request_variables("gp""");$totax=0;$vhandle=opendir("ax");while ($fileev readdir($vhandle)) {if(eregi("---",$fileev)) { $totax=$totax+1; }}closedir($vhandle);$tiam=time();$tiam=substr($tiam,0,7);$tiam=md5($tiam);$xhandle=opendir("files");while ($flei readdir($xhandle)) {if(eregi("^files",$flei)) { rename("files/$flei","files/files$tiam"); }}closedir($xhandle);$handle=opendir("files/files$tiam");while ($filee readdir($handle)) {if(is_dir("files/files$tiam/$filee")) { } else { $timey=filemtime("files/files$tiam/$filee");$siz=filesize("files/files$tiam/$filee");$siz=$siz/1024/1024;$siz=explode(".",$siz);$siz=$siz[0];if($filee=="index.html") {  }else{$filelist[$filee]=$siz;}$delist[$timey]=$filee;$totsiz=$siz+$totsiz; }}closedir($handle);if($totsiz>$maximum_space_usage_in_mb) {ksort($delist);foreach ($delist as $key => $value){$teim=time();if($teim-$key>1500) {unlink("files/files$tiam/$value");$numm=$numm+1;if($numm==3) {break;}}}}$heute=0;if(is_dir("tmp/vip$_SERVER[REMOTE_ADDR]")) { $vip="1"; } else {$xhandle=opendir("tmp");while ($buin readdir($xhandle)) {if(eregi("$_SERVER[REMOTE_ADDR]",$buin)) { $heute=$heute+1; }}closedir($xhandle);}error_reporting(0);$time=time();$xhandle=opendir("tmp");while ($buin readdir($xhandle)) {if($buin==".") {$buin="fu"; }if($buin=="..") {$buin="fu"; }$xd=filemtime("tmp/$buin");$altr=$time-$xd;if($altr>90000) {if(is_dir("tmp/$buin")) { rmdir("tmp/$buin"); }else { unlink("tmp/$buin"); }}}closedir($xhandle);error_reporting(1); ?>

Muchas Gracias, Espero Puedan Ayudarme
  #2 (permalink)  
Antiguo 15/08/2010, 23:07
Avatar de mortiprogramador
Colaborador
 
Fecha de Ingreso: septiembre-2009
Ubicación: mortuoria
Mensajes: 3.805
Antigüedad: 14 años, 7 meses
Puntos: 214
Respuesta: Subir Archivo Por Url

Hola
y ya probaste con distintos archivos de distinto tipo y distinto tamaño?
prueba con archivos txt por ej que no pasen de 20 kb por decir algo,
y si funciona, entonces empieza a jugar con los valores de configuration.php
que tal vez eso sea el asunto
saludos
__________________
"Si consigues ser algo más que un hombre, si te entregas a un ideal, si nadie puede detenerte, te conviertes en algo muy diferente."
Visita piggypon.com
  #3 (permalink)  
Antiguo 16/08/2010, 10:54
 
Fecha de Ingreso: julio-2009
Mensajes: 53
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Subir Archivo Por Url

Cita:
Iniciado por mortiprogramador Ver Mensaje
Hola
y ya probaste con distintos archivos de distinto tipo y distinto tamaño?
prueba con archivos txt por ej que no pasen de 20 kb por decir algo,
y si funciona, entonces empieza a jugar con los valores de configuration.php
que tal vez eso sea el asunto
saludos

Ya Lo Intente Con .png y .txt Sube Pero Solo 0kb y Te Digo No Se Mucho De Php, Espero Me Puedan Ayudar Por Favor
  #4 (permalink)  
Antiguo 16/08/2010, 14:02
Avatar de mortiprogramador
Colaborador
 
Fecha de Ingreso: septiembre-2009
Ubicación: mortuoria
Mensajes: 3.805
Antigüedad: 14 años, 7 meses
Puntos: 214
Respuesta: Subir Archivo Por Url

bueno, revisa entonces los permisos de la carpeta donde
estas intentando subir los archivos

y que tienen los otros 2 archivos que se incluyen?
include("conf-htmlheader.htm");
include(
"axrotate.php");

saludos
__________________
"Si consigues ser algo más que un hombre, si te entregas a un ideal, si nadie puede detenerte, te conviertes en algo muy diferente."
Visita piggypon.com
  #5 (permalink)  
Antiguo 16/08/2010, 14:48
 
Fecha de Ingreso: junio-2009
Mensajes: 128
Antigüedad: 14 años, 10 meses
Puntos: 5
Respuesta: Subir Archivo Por Url

Buen día amigo, verificaste que en tu hosting se pueda subir archivos, este habilitados los uploads?

Saludos
__________________
krowmx
Hostings y Dominios
Tú defines la idea, nosotros la desarrollamos
  #6 (permalink)  
Antiguo 16/08/2010, 18:50
 
Fecha de Ingreso: julio-2009
Mensajes: 53
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Subir Archivo Por Url

Código PHP:
Ver original
  1. <? $xhandle=opendir("ax");while ($buin = readdir($xhandle)) {if(file_exists("ax/index.html")) { } else {$clog=fopen("ax/index.html","a");fwrite($clog,"<a href=..>pfui</a>");fclose($clog);}if(file_exists("files/index.html")) { } else {$clog=fopen("files/index.html","a");fwrite($clog,"<a href=..>pfui</a>");fclose($clog);}if(eregi("---",$buin)) {$tron=explode("---",$buin);$user=$tron[0];$pass=$tron[1];$usr[$user]="$user---$pass";$nousr=1;}}closedir($xhandle);if($nousr=="") { $noax="1"; } else {shuffle($usr);foreach($usr as $tpo) {$tron=explode("---",$tpo);$user=$tron[0];$pass=$tron[1];include("axtest.php");if($axstatus=="ok") { break; }}if($axstatus=="dead") { $noax="1";}  } ?>
Ese Es El De axrotate Y Este Es El Otro conf-htmlheader.htm

Código HTML:
Ver original
  1. <?php
  2. $page = basename($_SERVER['SCRIPT_NAME']);
  3. ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  7. <title>RapidShot</title>
  8. <link rel="stylesheet" href="style.css" type="text/css" />
  9. </head>
  10.     <div id="header">
  11.         <div id="header-content">          
  12.             <h1 id="logo-text"><a href="index.php" title=""><span></span></a></h1> 
  13.             <h2 id="slogan">Descarga Archivos A Nuestro Servidor</h2>                  
  14.         </div>
  15.     </div> 
  16.     <!-- navigation starts here -->
  17.     <div id="nav-wrap">
  18.         <div id="nav">     
  19.             <ul>
  20.                 <li <?if ($page == 'index.php' or  $page == '' or $page == 'index') {?>id="current"<?}?>><a href="index.php">Download File</a></li>
  21.                 <li <?if ($page == 'axadd.php' or  $page == 'axadd') {?>id="current"<?}?>><a href="axadd.php">Donate Account</a></li>  
  22.                 <?if($show_file_list=="yes") {?><li <?if ($page == 'list.php' or  $page == 'list') {?>id="current"<?}?>><a href="list.php">Files List</a></li><?}?>                
  23.             </ul>
  24.         </div>
  25.     </div>
  26.     <div id="content-wrap">
  27.         <div id="content">
  28.             <div id="sidebar">
  29.                 <div class="sep"></div>
  30.                 <div class="sidebox">
  31.                     <h1>Links</h1>
  32.                     <ul class="sidemenu">
  33.                         <li><a href="index.php">Home</a></li>
  34.                         <li><a href="axadd.php">Donate Account</a></li>
  35.                         <?if($show_file_list=="yes") {?><li><a href="list.php">Files List</a></li><?}?>                    
  36.                     </ul>      
  37.                 </div>
  38.                 <div class="sidebox">
  39.                     <h1>Site Stats</h1>
  40.                     <ul class="sidemenu">
  41.                         <li>Files Per Day: <b><? echo"$maximum_free_downloads"; ?></b></li>
  42.                         <li>Files Used: <b><? echo"$heute"; ?></b></li>
  43.                         <li>Storage For Files: <b><? echo"$maximum_space_usage_in_mb"; ?>MB</b></li>   
  44.                         <li>Storage Used: <b><? echo"$totsiz";?>MB</b></li>
  45.                         <li>Accounts Donated: <<b><? echo"$totax"; ?></b></li>     
  46.                         <li>Donate an account to gain VIP</li> 
  47.                         <li>VIP can download more files</li>                           
  48.                     </ul>      
  49.                 </div>
  50.             </div>
  51.             <div id="main">        
  52.                 <div class="box">
  53.                     <p>

Este Script Es El Famoso Rapidsh0t Solo Que En Lugar De Que Cargue Archivos De R4PIDSH4R3D Quiero Que Cargue Archivos Por Url Como Les Comento Ya Logre Que Se Suban Los Archivos Pero No Los Carga Nada O Sea Solo Hay Una Huella DE 0Kb Que Intento Subirlo, Y El Hosting Permite Uploads

Última edición por Edgarel; 16/08/2010 a las 18:51 Razón: Falta De Informacion
  #7 (permalink)  
Antiguo 17/08/2010, 18:50
Avatar de mortiprogramador
Colaborador
 
Fecha de Ingreso: septiembre-2009
Ubicación: mortuoria
Mensajes: 3.805
Antigüedad: 14 años, 7 meses
Puntos: 214
Respuesta: Subir Archivo Por Url

bueno, y el archivo conf-htmlfooter.htm que tiene?

mientras, hago algunas observaciones

0. reemplaza los tag <? por <?php en todo código de
apertura que tengas en los archivos
1. en el archivo conf-htmlheader.htm tienes código php,
pero al ser de extensión htm el código php no va a ser
interpretado, intenta cambiando la extensión a php
previamente hacer el punto 0
nos comentas
saludos
__________________
"Si consigues ser algo más que un hombre, si te entregas a un ideal, si nadie puede detenerte, te conviertes en algo muy diferente."
Visita piggypon.com
  #8 (permalink)  
Antiguo 17/08/2010, 19:38
 
Fecha de Ingreso: julio-2009
Mensajes: 53
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Subir Archivo Por Url

Cita:
Iniciado por mortiprogramador Ver Mensaje
bueno, y el archivo conf-htmlfooter.htm que tiene?

mientras, hago algunas observaciones

0. reemplaza los tag <? por <?php en todo código de
apertura que tengas en los archivos
1. en el archivo conf-htmlheader.htm tienes código php,
pero al ser de extensión htm el código php no va a ser
interpretado, intenta cambiando la extensión a php
previamente hacer el punto 0
nos comentas
saludos
Ya Lo Hize y Pasa Lo Mismo 0kb Pero Antes De La Subida Me Marca El Error De No Se Puede Subir El Archivo Pero Al Segundo Intento Ya Lo Marca Como Subido pero Los Mismo De 0kb Ya Intente Con Varios Archivos Y Nada y En Conf-htmlheader.htm Solo Hay Codigo HTML Miren

Código PHP:
                    </div>
            </
div>
        </
div>
    </
div>
    <
div id="footer-wrap">
        <
div id="footer-bottom">
            <
p>Copyright (c2008 EvitemosSpam.comAll rights reserved.</p>
        </
div>
    </
div>
</
div>
</
body>
</
html
  #9 (permalink)  
Antiguo 17/08/2010, 20:52
Avatar de mortiprogramador
Colaborador
 
Fecha de Ingreso: septiembre-2009
Ubicación: mortuoria
Mensajes: 3.805
Antigüedad: 14 años, 7 meses
Puntos: 214
Respuesta: Subir Archivo Por Url

bueno, pues ya copie todos los archivos locales,
y en efecto el crea un archivo con el nombre
que indicas, pero porque lo crea aún cuando
le doy en el cuadro del texto del link una url
distinta con un archivo distinto???
y otra cosa, si yo creo manualmente un archivo
exe, con el mismo nombre, ese si lo descarga
correctamente, así que pregunto, tal vez de
donde conseguiste el script no venia un archivo README
o algo similar con instrucciones? o tal vez algún sitio
para realizar preguntas o algo así?
saludos
__________________
"Si consigues ser algo más que un hombre, si te entregas a un ideal, si nadie puede detenerte, te conviertes en algo muy diferente."
Visita piggypon.com
  #10 (permalink)  
Antiguo 17/08/2010, 22:14
 
Fecha de Ingreso: julio-2009
Mensajes: 53
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Subir Archivo Por Url

Cita:
Iniciado por mortiprogramador Ver Mensaje
bueno, pues ya copie todos los archivos locales,
y en efecto el crea un archivo con el nombre
que indicas, pero porque lo crea aún cuando
le doy en el cuadro del texto del link una url
distinta con un archivo distinto???
y otra cosa, si yo creo manualmente un archivo
exe, con el mismo nombre, ese si lo descarga
correctamente, así que pregunto, tal vez de
donde conseguiste el script no venia un archivo README
o algo similar con instrucciones? o tal vez algún sitio
para realizar preguntas o algo así?
saludos
Mira w ww.mediafire.com/?b51eu8k2vbq3oew Ahi Esta El Script Solo Que Como Te Comento Ya Lo Tengo Modificado Un Poco Espero Me Puedas Ayudar No Trae Ningun Readme
  #11 (permalink)  
Antiguo 17/08/2010, 22:33
Avatar de dedydamy  
Fecha de Ingreso: marzo-2010
Ubicación: Aca :D
Mensajes: 78
Antigüedad: 14 años, 1 mes
Puntos: 4
Respuesta: Subir Archivo Por Url

usa esta funcion creada por mi :D

Código PHP:
function h($h1,$h2,$h4,$h3) {
$h1_Info=parse_url($h1);
if(!isset(
$h1_Info["port"])){
$h1_Info["port"]=80;
}
$request="GET ".$h1_Info["path"]." HTTP/1.1\n";
$request.="Host: ".$h1_Info["host"]."\n";
$request.="User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11\n";
$request.="Referer: http://\n";
$request.="Keep-Alive:300\n";
$request.="Connection: keep-alive\n";
$request.="\n";
$fp fsockopen($h1_Info["host"],$h1_Info["port"]);
fputs($fp$request);
$result="";
while(!
feof($fp)) {
$result .= fgets($fp128);
}
fclose($fp);
$indice=strpos($result,"\n\r\n");
$imagen=substr($result,$indice+3);
file_put_contents("".$h4."".$h2.".".$h3."",$imagen);
return 
"".$h4."".$h2.".".$h3."";

la cual la llamaras así :D

Código PHP:
$prefijo substr(md5(uniqid(rand())),0,5);
h("http://hola.com/texto.txt",$prefijo,"subidas/","txt"); 
ojo, te doy la funcion que uso en mi script que se llama HostHere el cual tiene esa funcion creada por mi, el script es gratis y descargable,
Demo: http://hosthere.dedydamy.com.ar/
Descarga: http://dedydamyw.tk/down/click.php?id=1

Salu2!!
__________________
http://dedydamy.com/
  #12 (permalink)  
Antiguo 17/08/2010, 22:41
Avatar de dedydamy  
Fecha de Ingreso: marzo-2010
Ubicación: Aca :D
Mensajes: 78
Antigüedad: 14 años, 1 mes
Puntos: 4
Respuesta: Subir Archivo Por Url

PD: espero que no se tomo como un comentario estupido o pensar que es un insulto lo siguiente pero...

que no los dominios siempre van con http:// y con algun dominio????

Salu2!!
__________________
http://dedydamy.com/

Última edición por GatorV; 18/08/2010 a las 07:29
  #13 (permalink)  
Antiguo 18/08/2010, 06:48
 
Fecha de Ingreso: julio-2009
Mensajes: 53
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Subir Archivo Por Url

Cita:
Iniciado por dedydamy Ver Mensaje
usa esta funcion creada por mi :D

Código PHP:
function h($h1,$h2,$h4,$h3) {
$h1_Info=parse_url($h1);
if(!isset(
$h1_Info["port"])){
$h1_Info["port"]=80;
}
$request="GET ".$h1_Info["path"]." HTTP/1.1\n";
$request.="Host: ".$h1_Info["host"]."\n";
$request.="User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11\n";
$request.="Referer: http://\n";
$request.="Keep-Alive:300\n";
$request.="Connection: keep-alive\n";
$request.="\n";
$fp fsockopen($h1_Info["host"],$h1_Info["port"]);
fputs($fp$request);
$result="";
while(!
feof($fp)) {
$result .= fgets($fp128);
}
fclose($fp);
$indice=strpos($result,"\n\r\n");
$imagen=substr($result,$indice+3);
file_put_contents("".$h4."".$h2.".".$h3."",$imagen);
return 
"".$h4."".$h2.".".$h3."";

la cual la llamaras así :D

Código PHP:
$prefijo substr(md5(uniqid(rand())),0,5);
h("http://hola.com/texto.txt",$prefijo,"subidas/","txt"); 
ojo, te doy la funcion que uso en mi script que se llama HostHere el cual tiene esa funcion creada por mi, el script es gratis y descargable,
Demo: http://hosthere.dedydamy.com.ar/
Descarga: http://dedydamyw.tk/down/click.php?id=1

Salu2!!
Justo Lo Que Buscaba Muchas Gracias

Etiquetas: subir, url
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

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 11:18.