鍍金池/ 問(wèn)答/PHP/ 小程序 uploadfile 貌似不生效

小程序 uploadfile 貌似不生效

uploadfile success fail complete 一個(gè)都沒(méi)執(zhí)行

1.微信平臺(tái) 開發(fā)者那里 已經(jīng)填寫了url https://www.xxx.com 但是 請(qǐng)求地址是 https://www.xxx.com/xxx/a/b/c 這個(gè)關(guān)系嗎?
2.微信開發(fā)工具關(guān)閉tls驗(yàn)證 這個(gè)關(guān)系嗎?

clipboard.png

回答
編輯回答
夏夕
var header = { 'content-type': 'application/x-www-form-urlencoded' } 
wx.uploadFile({
    url: app.globalData.APIURL+'/xcxupimg.php', //僅為示例
    filePath:tempFilePaths[0],
    name:'Photo',
    header: header, // 設(shè)置請(qǐng)求的 header
    formData: {
     // PHPSESSID:app.globalData.PHPSESSID,
    }, // HTTP 請(qǐng)求中其他額外的 form data

我的這個(gè)沒(méi)問(wèn)題 你看看是不是header頭的問(wèn)題
另外 請(qǐng)求地址不能有參數(shù)
類似 http://www.123.cn/index.php?M... 這種寫法的請(qǐng)求地址 只會(huì)找到index.php 不會(huì)去找模塊控制器什么的

2017年4月3日 07:06