pastebin - collaborative debugging tool
kpaste.net RSS


PHP File Upload Test
Posted by HellFire on Tue 24th Apr 2012 21:49
raw | new post

  1. <?php
  2. if ($_FILES) {
  3.         echo "<pre>";
  4.         print_r($_FILES);
  5.         echo "</pre>";
  6.         unlink($_FILES["userfile"]["tmp_name"]);
  7. }
  8. ?>
  9. <!-- The data encoding type, enctype, MUST be specified as below -->
  10. <form enctype="multipart/form-data" action="?" method="POST">
  11.     <!-- Name of input element determines name in $_FILES array -->
  12.     Send this file: <input name="userfile" type="file" />
  13.     <br/>
  14.     <input type="submit" value="Send File" />
  15. </form>

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at