[ASK] Membuat php upload, agar nama file auto rename menjadi angka sesuai jumlah uploadnya

Discussion in 'Desain Web dan Programming' started by irulmaleo, 30 Jun 2015.

Thread Status:
Not open for further replies.
  1. irulmaleo

    irulmaleo Beginner 1.0

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    [ASK] Please help !!! Membuat php upload, agar nama file yang kita upload auto rename menjadi angka sesuai jumlah uploadnya :39: :cheer2::cheer2:
     
  2. sentabi

    sentabi Expert 1.0

    Messages:
    681
    Likes Received:
    35
    Trophy Points:
    28
    scriptnya udah sampe mana
     
  3. fire.man

    fire.man Poster 2.0

    Messages:
    157
    Likes Received:
    18
    Trophy Points:
    18
    udah bikin source code nya mas?
     
  4. masiqbal

    masiqbal Expert 2.0

    Messages:
    863
    Likes Received:
    249
    Trophy Points:
    43
    Saya terus terang masih belum mengerti maksudnya. Mungkin yang dimaksud upload banyak file sekaligus terus namanya diubah sesuai urutannya?

    HTML:
    <form action="file-upload.php" method="post" enctype="multipart/form-data">
    Send these files:<br />
    <input name="userfile[]" type="file" /><br />
    <input name="userfile[]" type="file" /><br />
    <input name="userfile[]" type="file" /><br />
    <input name="userfile[]" type="file" /><br />
    <input type="submit" value="Send files" />
    </form>
    
    PHP:
    // file-upload.php
    $ekstensi '.jpg'// misalnya
    foreach ($_FILES['userfile']['name'] as $no => $file){
        
    $namaBaru $no.$ekstensi;
        
    move_uploaded_file($_FILES['userfile']['tmp_name'][$no], $namaBaru);
    }

     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...