how to upload a file via web browser?

Posted on 2005-04-25
Last Modified: 2010-04-17
Could someone please describe (in detail please!) how I can create a page where people can upload files to a directory in my website?

Thank you!  (support for php and stuff, but I have no idea how to use them)
Question by:galneweinhaw
    LVL 55

    Assisted Solution

    by:Jaime Olivares
    Since is a common question, have a look to this previous answer:
    If you have any doubt, please advice.
    LVL 14

    Accepted Solution

    Here is a simple way:


         <FORM ACTION="upload.php" METHOD=POST ENCTYPE="multipart/form-data">
          Submit this File: <INPUT TYPE=FILE NAME="theFile"><BR>

          if(copy($theFile, "locationToSaveFile"))
               echo("File upload successful");
               echo("File upload unsuccessful");

          unlink($theFil); //destroys file  


    hope this helps a bit


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
    This is an explanation of a simple data model to help parse a JSON feed
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now