小程序解决多图片上传到服务器问题

js:
choose: function () {
    var that = this
    wx.chooseImage({
      count:9,
      sizeType: ['original', 'compressed'], 
      sourceType: ['album', 'camera'], 
      success: function (res) {
        var tempFilePaths = res.tempFilePaths
        that.setData({
          tempFilePaths: res.tempFilePaths
        })
        wx.setStorage({ key: "card", data: tempFilePaths })
      }
    })
},
  
fabu: function (e) {
	var that = this
	var card = wx.getStorageSync('card')
	console.log(card);
	for(var i=0;i
	


php:
$imgname = $_FILES['myfile']['name'];
$tmp = $_FILES['myfile']['tmp_name'];
if(move_uploaded_file($tmp,$imgname.".png")){
	exit(json_encode("上传成功"));
}else{
	exit(json_encode("上传失败"));
}

小程序解决多图片上传到服务器问题_第1张图片

小程序解决多图片上传到服务器问题_第2张图片

你可能感兴趣的:(PHP,微信)