tnblog
首页
视频
资源
登录

微信上传视频容易踩的坑

4120人阅读 2019/12/17 9:09 总访问:349085 评论:0 收藏:0 手机
分类: 笔记

微信开发文档上的讲解有误 不能按照上面的思路来


这个时候我们需要合二为一 把他组合在一起

 

<form id="form1" method="post" enctype="multipart/form-data" action="https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=@token&type=video">
    <input type="file" value="浏览" name="media" />
    <input type="text" id="description" name="description" />// 注意id必须为 description  否则会报数据文件传输丢失. 

<input type="button" value="上传" onclick="shang()" />
</form>



<script>
    var shang = function () {
        var former = document.getElementById("form1");
        console.log(former);
        //描述
        var cont = document.getElementById("description");
        var jsonobj = {};
        jsonobj.title = "微信小视频";
        jsonobj.introduction = "微信测试视频";

        console.log(cont);
        cont.value = JSON.stringify(jsonobj);
       
        former.submit();
        
    }
    
</script>



评价
每一段旅程,都是一种领悟
排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2024TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
欢迎加群交流技术