HELP - Multi file uploader

Discussion in 'PHP' started by KingCobra, May 21, 2009.

  1. #1
    I need a good PHP-mySQL multi file uploader (better, if with process basr/status),

    that

    * rename the file names
    * insert file names in seperate mysql row
    * upload files to specified dir

    Please HELP me
     
    KingCobra, May 21, 2009 IP
  2. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #2
    do you know any PHP?
    You're not looking for full free code are you? lol

    Post the code you have and people will tell you whats wrong with it.
    If you want entire code.. get out your wallet
     
    ezprint2008, May 21, 2009 IP
  3. SHOwnsYou

    SHOwnsYou Peon

    Messages:
    209
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This should work. I didn't test it though.

    <?php 
    if(isset($_POST['upload'])) {
    #Splits file name and file extension
    function findexts ($uploaded)
    {
    $filename = strtolower($uploaded) ;
    $exts = split("[/\\.]", $filename) ;
    $n = count($exts)-1;
    $exts = $exts[$n];
    return $exts;
    }
    $ext = findexts ($_FILES['uploaded']['name']) ; 
    #Renames the file to the current time.
    $ran = time();
    $ran2 = $ran.".";
    #Target is where your file will upload to.
    $target = "/your/images/directory/";
    $target = $target . $ran2.$ext; 
    $ok=1;
    if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
    {
    echo "The file ". $ran2.$ext . " has been uploaded";
    $name = $ran2.$ext ;
    }
    else {
    echo "Sorry, there was a problem uploading your file.";
    }
    mysql_query("INSERT INTO `table` (`filecolumninDB`) VALUES ('$name')") or die(mysql_error());
    ?>
    <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data">
    File:<input type="file" name="uploaded" />
    <br />
    <input type="submit" name="upload" value="Upload!"/> </form>
    Code (markup):
     
    SHOwnsYou, May 21, 2009 IP
  4. KingCobra

    KingCobra Well-Known Member

    Messages:
    289
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #4
    I know PHP, JSP, mySQL, Oracle
    I have multiple file (manually coded upload box) upload system (without processbar)
     
    KingCobra, May 21, 2009 IP
  5. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #5
    If you want the ability to have a "fancy" upload box with the ability to chose multiple files, you need a flash-uploader. HTML-forms / PHP-processing needs separate browse/file-picker boxes to chose multiple files. Also, for a progress bar, you need at least some javascript, more properly some AJAX which can communicate with the server and post back info.
     
    PoPSiCLe, May 21, 2009 IP
  6. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i think the qooy.com might be what you want? google for it, it's around. :)
     
    szalinski, May 22, 2009 IP