欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP 文件上传示例

程序员文章站 2024-01-21 18:05:34
...
  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