Home > Backend Development > PHP Tutorial > javascript - 微信jssdk能上传多张图片吗?

javascript - 微信jssdk能上传多张图片吗?

WBOY
Release: 2016-06-06 20:36:32
Original
1325 people have browsed it

通过调用wx.chooseImage能从手机相册中选择一张或多张图片,如选择2张图片,下面的localIds.length为2。当时选择一张图片上传的时候能上传成功,选择多张图片则只能上传一张。wx.uploadImage的回调方法也只执行一次。是我代码写的不对还是微信限制只能一张。。

var localIds = res.localIds;
alert(localIds.length);

<code>            for (var i = 0; i<localids.length i wx.uploadimage localid: localids isshowprogresstips: success: function var serverid="res.serverId;" alert fail:></localids.length></code>
Copy after login
Copy after login

回复内容:

通过调用wx.chooseImage能从手机相册中选择一张或多张图片,如选择2张图片,下面的localIds.length为2。当时选择一张图片上传的时候能上传成功,选择多张图片则只能上传一张。wx.uploadImage的回调方法也只执行一次。是我代码写的不对还是微信限制只能一张。。

var localIds = res.localIds;
alert(localIds.length);

<code>            for (var i = 0; i<localids.length i wx.uploadimage localid: localids isshowprogresstips: success: function var serverid="res.serverId;" alert fail:></localids.length></code>
Copy after login
Copy after login

解决了,原来不能同时传多张,只能等上一张传完才能开始下一张

在他的文档中有demo的。

我这边遇到微信图片上传 有时候成功有时候不成功,debug为true的情况都可以成功,不知道是否遇到过啊

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template