IPB

Welcome Guest ( Log In | Register )



Tags
This content has not been tagged yet
 
Reply to this topicStart new topic

upload files


LuciferStar
no avatar
Advanced Member
*******
Group: Members
Posts: 114
Joined: 9-August 04
From: Suzhou Jiangsu China
Member No.: 743



Post #1 post Aug 9 2004, 10:59 AM
upload.php

CODE
<?php[br]/**********************************[/br]*[br]**      file directory list[/br]*[br]**********************************/[/br]function listthem($add)[br]{[/br]   $t=$add;[br]   if ($handle = opendir($add))[/br]   {[br]      while (($file = readdir($handle))!=FALSE)[/br]      {[br]          $add.="/".$file;[br][/br]          if (is_dir($add)==TRUE)[/br]          { [br]              if($file!="." && $file!=".." && is_dir($add)==TRUE)[/br]              {[br]                  echo "    <option value=\"".$add."\">".$add."</option>";[/br]                  listthem($add);[br]              }[/br]          }[br]          $add=$t;[/br]      }[br]      closedir($handle); [/br]   }[br]}[/br]function getdir($add)[br]{[/br]?>[br]  <input type="hidden" name="MAX_FILE_SIZE" value="200000">[/br]upload limitations! less than 200KB。<p>[br]WHERE TO UPLOAD <select size="1" name="DIR"> [/br]         <option value="">.</option>[br]<?php listthem($add);?>[/br]</select>[br]<?php[/br]}[br][/br]if($_POST['NAME']=="LuciferStar")//change your name for secu[br]{           //password is not required in this edition[/br]  setcookie("TestCookies",md5($_POST['NAME']),time()+3600);[br][/br]  $i=0;[br]  echo "  <form enctype=multipart/form-data action=savefile.php?NUMBER=".$_POST['NUMBER']." method=post>";[/br]  ?>[br]  <?php $add="."; getdir($add);?>[/br]  <?php[br]  while($i<$_POST['NUMBER'])[/br]  {[br]    $file=sprintf("userfile%d",$i);[/br]    $i++;[br]    echo "<p>File $i <input name=$file type=file> ";[/br]  }[br]  echo "<input type=submit value=upload>";[br]}[/br]else[br]{[/br]?>[/br]<form action="upload.php" method="post">[br]<p>USER <input name="NAME" type="text"></p>[/br]<p>PASS &nbsp; <input name="PASS" type="password"></p>[br]<p>NUMBER <input name="NUMBER" type="text"></p>[/br]<input type=submit>[br]</form>[/br]<?php[br]}[/br]?>[br]</p>  [/br]</form>
Go to the top of the page
+Quote Post
LuciferStar
no avatar
Advanced Member
*******
Group: Members
Posts: 114
Joined: 9-August 04
From: Suzhou Jiangsu China
Member No.: 743



Post #2 post Aug 9 2004, 11:01 AM
savefile.php[br]
CODE
<?php [/br]function upload($form)[br]{[/br]   $filename=$_FILES[$form]['name'];[br]   if($filename!=NULL)[/br]   {[br]      $l=strlen($filename);[/br]      $rest = substr($filename,$l-3 ,$l );[br][/br]         if($_POST['DIR']!=NULL)  $filename=sprintf("%s/%s",$_POST['DIR'],$filename);[br]         else $filename=sprintf("%s",$filename);[br][/br]      if (is_uploaded_file($_FILES[$form]['tmp_name'])) [/br]      { [br]         if(move_uploaded_file($_FILES[$form]['tmp_name'], $filename)) [/br]         {//echo $_FILES[$form]['tmp_name'];[br]            echo "<p>uploaded file: ".$_FILES[$form]['name']." done.";[/br]            echo "<p>link:<a href=\"".$filename."\"></a>";[br]         }[/br]      }[br]      else[/br]      {[br]         echo "Possible file upload attack. Filename: " . $_FILES[$form]['name'];[/br]      }[br]   }[/br]}[br]$i=0;[/br]while($i<$_REQUEST['NUMBER'])[br]{[/br]$file=sprintf("userfile%d",$i);[br]upload($file);[/br]$i++;[br]}[/br]?>
Go to the top of the page
+Quote Post
Roly
no avatar
Advanced Member
*******
Group: Members
Posts: 144
Joined: 24-July 04
From: Arizona
Member No.: 189



Post #3 post Aug 18 2004, 04:19 AM
Are you just showing us your code or do you have an error with it and need help?
Go to the top of the page
+Quote Post
Spectre
no avatar
Privileged Member
*********
Group: Members
Posts: 873
Joined: 30-July 04
Member No.: 246



Post #4 post Aug 18 2004, 05:22 AM
*Spam removed.

Stop spamming in the forums.

LuciferStar, please include a description of your scripts, and whether or not you wrote them.
Go to the top of the page
+Quote Post
LuciferStar
no avatar
Advanced Member
*******
Group: Members
Posts: 114
Joined: 9-August 04
From: Suzhou Jiangsu China
Member No.: 743



Post #5 post Aug 19 2004, 01:39 AM
QUOTE (Sauron @ Aug 18 2004, 05:22 AM)
*Spam removed.

Stop spamming in the forums.

LuciferStar, please include a description of your scripts, and whether or not you wrote them.

I got it.

This code is shared.
I just paste this code for share.

some websites did not support ftp,and their webftps are not good enough,every upload time,can only upload 5 / 10 files.

But my code can upload as many as you like.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No new   20 KansukeKojima 3,509 7th November 2009 - 10:28 PM
Last post by: TheDarkHacker
No New Posts 4 zip_mc 13,321 22nd September 2009 - 10:26 AM
Last post by: akira550
No New Posts   2 FallenSage 1,244 18th July 2006 - 05:28 AM
Last post by: FallenSage
No New Posts   7 football123213 15,617 20th August 2004 - 12:25 AM
Last post by: ill
No new   27 OpaQue 25,308 18th October 2007 - 05:33 AM
Last post by: rvalkass
No New Posts   12 -prodigy- 12,335 22nd September 2004 - 04:34 AM
Last post by: -prodigy-
No New Posts   3 Zenchi 4,863 13th October 2004 - 03:36 PM
Last post by: ElBandoneonWEbsite
No New Posts   3 guangdian 4,952 20th August 2009 - 06:59 PM
Last post by: iworld200
No New Posts   1 hansley 7,697 11th October 2004 - 03:54 AM
Last post by: Trystim
No New Posts   13 Lyon 5,408 8th April 2009 - 07:21 PM
Last post by: Lyon2
No New Posts   10 odomike 7,451 10th February 2005 - 08:22 PM
Last post by: round
No New Posts   6 sargilla 6,810 4th November 2004 - 02:54 PM
Last post by: Lyon
No new   20 sargilla 10,708 1st November 2009 - 11:36 PM
Last post by: Soviet Rathe
No New Posts   4 AlternativeNick 825 10th June 2006 - 09:08 PM
Last post by: farsiscript
No New Posts   0 twoq 4,332 7th November 2004 - 06:19 AM
Last post by: twoq


 



RSS Open Discussion Time is now: 22nd November 2009 - 04:25 AM

Web Hosting Powered by ComputingHost.com.