Home  >  Article  >  Backend Development  >  PHP file upload example

PHP file upload example

WBOY
WBOYOriginal
2016-07-25 08:45:15761browse
  1. File Uploader
  2. File Upload

  3. Select a file to upload:

复制代码

uploader.php
  1. if( $_FILES['file']['name'] != "" )
  2. {
  3. copy ( $_FILES['file']['tmp_name'],
  4. "C:/Apache/htdocs/" . $_FILES['file']['name'] )
  5. or die( "Could not copy file" );
  6. }
  7. else
  8. {
  9. die( "No file specified" );
  10. }
  11. ?>
  12. Upload complete
  13. File upload succeeded...

    • Sent:
    • Size: bytes
    • Type:
  14. Click here to view file
复制代码

文件上传, PHP


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn