how to upload a file via web browser?

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)
galneweinhawAsked:
Who is Participating?
 
Juan OcasioApplication DeveloperCommented:
Here is a simple way:

input.html:

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



upload.php:
<html>
    <?
      if(copy($theFile, "locationToSaveFile"))
      {      
           echo("File upload successful");
      }
      else
      {    
           echo("File upload unsuccessful");
      }

      unlink($theFil); //destroys file  
     ?>

</HTML>

hope this helps a bit

jocasio
0
 
Jaime OlivaresSoftware ArchitectCommented:
Since is a common question, have a look to this previous answer:
http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_10810564.html
If you have any doubt, please advice.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.