今天给移动的上传接口,上传多张照片总是只有一张成功,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属性只有一个,尝试改成不同的值,果然就成功了。

相关文章:

  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
  • 2021-07-30
  • 2021-06-26
  • 2022-01-15
猜你喜欢
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
  • 2021-07-19
  • 2021-05-27
相关资源
相似解决方案