upload multiple files...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • leen

    upload multiple files...

    hola..
    i need a help...this is my coding for uploading multiple files...the
    problem is..i want the files that i have been upload will show in the
    same page but using only one text box..can anyone help me?plz...i
    really need a help..

    <HTML>
    <HEAD>
    <title>FILE UPLOAD</title>
    <body bgcolor="magent a">



    <form method="POST" ENCTYPE="multip art/form-data"
    action="uploadf ile.php">



    <p>
    Files:<br>

    <input type="file" name="uploadFil e" size="40">

    <br>
    <input type="file" name="uploadFil e2" size="40">
    </p>
    <p>
    <input type="submit" value="Submit">


    <br>
    <br>
    <?php



    // Where the file is going to be placed
    $target_path = "uploads/";

    /* Add the original filename to our target path.
    Result is "uploads/filename.extens ion" */
    $target_path = $target_path . basename( $_FILES['uploadFile']['name']);

    $_FILES['uploadFile']['tmp_name'];


    $target_path = "uploads/";

    $target_path = $target_path . basename( $_FILES['uploadFile']['name']);


    if(move_uploade d_file($_FILES['uploadFile']['tmp_name'], $target_path))
    {
    echo "The file ". basename( $_FILES['uploadFile']['name']).
    " has been uploaded = ";
    } else{
    echo " ";
    }

    $target_path = "uploads/";
    $target_path = $target_path . basename( $_FILES['uploadFile']['name']);
    $target_name = basename( $_FILES['uploadFile']['name']);
    $dir=" ";

    echo "<a href='{$dir}/{$target_path}' >{$target_name} </a><br />";






    // Where the file is going to be placed
    $target_path = "uploads/";

    /* Add the original filename to our target path.
    Result is "uploads/filename.extens ion" */
    $target_path = $target_path . basename(
    $_FILES['uploadFile2']['name']);
    $_FILES['uploadFile2']['tmp_name'];


    $target_path = "uploads/";

    $target_path = $target_path . basename(
    $_FILES['uploadFile2']['name']);

    if(move_uploade d_file($_FILES['uploadFile2']['tmp_name'],
    $target_path)) {
    echo "The file ". basename( $_FILES['uploadFile2']['name']).
    " has been uploaded = ";
    } else{
    echo " ";
    }

    $target_path = "uploads/";
    $target_path = $target_path . basename(
    $_FILES['uploadFile2']['name']);
    $target_name = basename( $_FILES['uploadFile2']['name']);
    $dir=" ";

    echo "<a href='{$dir}/{$target_path}' >{$target_name} </a><br />";




    ?>
    </form>


    </body>
    </HEAD>
    </HTML>

Working...