zoukankan      html  css  js  c++  java
  • php 多文件上传

    这个是对单文件上传的补充,只要是让大家知道有这么回事
    没有对安全等考虑的很全面,请大家修正,谢谢

    单文件

    index.php

    <form atcion="action.php" method="post" enctype="multipart/form-data">
        <input type="file" name="fileField1" />
    </form>
    

    当需要上传二进制文件时,记得 enctype="multipart/form-data"

    <?php
    var_dump($_FILES);
    ?>
    
    现在的$_FILES只有一个索引,就是
    $_FILES => array{
      fileField1 =>array
        'name' =>'****',
        'type' => .....
        ..
      }
    }

    多文件
    index.php
    <form atcion="action.php" method="post" enctype="multipart/form-data">
        <input type="file" name="fileField1" />
        <input type="file" name="fileField2" />
        <input type="file" name="fileField3" />
        <input type="file" name="fileField4" />
        <input type="file" name="fileField5" />
    </form>
    

    现在提交到action.php后,$_FILES的内部结构会是这样:

    $_FILES => array{
      fileField1 =>array
        'name' =>'****',
        'type' => .....
        ..
      },
      fileField2 =>array
        'name' =>'****',
        'type' => .....
        ..
      },  
      fileField3 =>array
        'name' =>'****',
        'type' => .....
        ..
      },
      fileField4 =>array
        'name' =>'****',
        'type' => .....
        ..
      }
      fileField5 =>array
        'name' =>'****',
        'type' => .....
        ..
      }  }
  • 相关阅读:
    【WinAPI】User32.dll注释
    Unity 用ml-agents机器学习造个游戏AI吧(1) (Windows环境配置)
    Unity C#笔记 容器类
    Unity C#笔记 委托/事件/Action/Func/Lambda表达式
    Unity C#笔记 协程
    游戏AI之模糊逻辑
    游戏AI之路径规划
    游戏设计模式——黑板模式
    游戏AI之决策结构—行为树
    游戏AI之感知
  • 原文地址:https://www.cnblogs.com/zcy_soft/p/2150968.html
Copyright © 2011-2022 走看看