File Manipulation Code

  Home arrow File Manipulation Code arrow Multiple File Upload
FILE MANIPULATION CODE

Multiple File Upload
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2002-11-05

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    This function is to upload multiple file to your webserver. Don't forget to 1.CHMOD 777 to the directory where the file being uploaded. 2. Make sure that directory is not under your web visitor directory.

    By : hermawan

    <?php
    /***********************************************
    * Snippet Name : File Uploader *
    * Scripted By : Hermawan Haryanto *
    * Website : http://hermawan.com *
    * Email : hermawan@codewalkers.com *
    * License : GPL (General Public License) *
    ***********************************************/
    $numoffile = 5;
    // Fix path of your file to be uploaded, don't forget to CHMOD 777 to this folder
    $file_dir = "/home/webs/dmonster.com/subdomain/files/";
    if ($_POST) {
    for ($i=0;$i<$numoffile;$i++) {
    if (trim($_FILES['myfiles']['name'][$i])!="") {
    $newfile = $file_dir.$_FILES['myfiles']['name'][$i];
    move_uploaded_file($_FILES['myfiles']['tmp_name'][$i], $newfile);
    $j++;
    }
    }
    }
    if (isset($j)&&$j>0) print "Your file(s) has been uploaded.<br>";
    print "<form method='post' enctype='multipart/form-data'>";
    for($i=0;$i<$numoffile;$i++) {
    print "<input type='file' name='myfiles[]' size='30'><br>";
    }
    print "<input type='submit' name='action' value='Upload'>";
    print "</form>";
    ?>

    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More File Manipulation Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    FILE MANIPULATION CODE ARTICLES

    - Bandwidth Control with pure PHP
    - Eazy Gallery
    - file_get_contents for PHP < 4.3.0
    - PHP Class: Image Snapshot 1.3
    - Universal downloader
    - Image Gallery v2.0
    - Free/Used Disk Space
    - Directory Lister
    - Directory image view, with selective hidden
    - Move or Copy a Directory (and files and sub ...
    - Ensure_Sub_Directory_Exists
    - Wedit
    - Form Examples Text Boxes to Drop Downs
    - myFiles
    - List files in a directory, no subdirectories


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap