zoukankan      html  css  js  c++  java
  • HttpContext.Current.Request.Files只能取到第一个文件

    今天给移动的上传接口,上传多张照片总是只有一张成功,HttpFileCollection files = HttpContext.Current.Request.Files

    调试发现取到的照片第一张后面的照片FilelLength=0;

    想起以前web端上传类似的问题:

    必须为file控件添加Name属性

    function newUpload(obj)
    {
        if(obj.value=="")
        {
            return;
        }
        else
        {
         var str = '<br/><input type="file" onchange="javascript:newUpload(this);"  runat="server"name="file"  />';
         document.getElementById('Upload1').insertAdjacentHTML("beforeEnd",str);
       }
    }

    然后查看移动端代码发现给的file的name属性只有一个,尝试改成不同的值,果然就成功了。

  • 相关阅读:
    vue中使用 canvas给页面添加水印
    c++ get keyboard event
    sublime text c++ makefile
    dddd
    songwenxin
    wechat
    ddd
    log
    v3
    xiaoxiaole
  • 原文地址:https://www.cnblogs.com/lyfingchow/p/7778624.html
Copyright © 2011-2022 走看看