This option will reset the home page of this site. Restoring any closed widgets or categories.

Reset

Simple file upload script using php

Here i will explain a simple php script which will upload files to a particular directory specified.

  1.  
  2. <?php
  3. session_start();
  4. if(!isset($_POST['upload'])) {
  5. echo ‘
  6. <form name=”upload” enctype=”multipart/form-data” method=”POST” action=”‘.$_SERVER['REQUEST_URI'].’”>
  7. <input type=”file” name=”file” size=”13″ value=”">
  8. <br /><input type=”submit” name=”upload” value=”Upload”>
  9. </form>
  10. ‘;
  11. } else {
  12. $yourdomain = ‘http://localhost/’;
  13. $uploaddir = ‘uploads/’;
  14. $filename = $_FILES['file']['name'];
  15. $filesize = $_FILES['file']['size'];
  16. $tmpname_file = $_FILES['file']['tmp_name'];
  17.   
  18. if($filesize > ‘1000000′) {
  19. echo “Way too big!!”;
  20. } else {
  21. move_uploaded_file($tmpname_file, “$uploaddir$filename”);
  22. echo “Successful.<br /><b>URL: </b>”.$yourdomain.$uploaddir.$filename.”</textarea>”;
  23. }
  24.   }
  25. ?> 
VN:F [1.5.7_846]
Rating: 0.0/10 (0 votes cast)
VN:F [1.5.7_846]
Rating: 0 (from 0 votes)
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • Xerpi

Related posts:

  1. Simple PHP mail Script
  2. Simple PHP Login Script
  3. Simple shell script to FTP file from your Desktop to FTP server
  4. Upload Your Scripts For Free
  5. Simple php watermark script
  6. File System Reference In PHP
  7. Find Absolute Path Of A File Or Directory Using PHP

2 Comments

  1. Ann says:

    Woow cool script

    VA:F [1.5.7_846]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.5.7_846]
    Rating: 0 (from 0 votes)
  2. zjdssvakhhm says:

    good one for script uopload

    VA:F [1.5.7_846]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.5.7_846]
    Rating: 0 (from 0 votes)

Leave a Reply

Spam Protected