本文目錄一覽:
php給安卓和ios提供圖片介面問題?
看你app 怎麼下載圖片的,已存在文件怎麼處理的?覆蓋寫 or 追加寫? 舊文件應該刪除吧
php微信拍照介面範例怎麼寫
// 圖片介面
//拍照、本地選圖
var images = {
localId: [],
serverId: []
};
wx.chooseImage({
success: function (res) {
images.localId = res.localIds;
alert(‘已選擇 ‘ + res.localIds.length + ‘ 張圖片’);
}
});
//上傳圖片
$(“#upload”).click(function(){
if (images.localId.length == 0) {
alert(‘請先使用 chooseImage 介面選擇圖片’);
return;
}
var i = 0, length = images.localId.length;
images.serverId = [];
function upload() {
wx.uploadImage({
localId: images.localId[i],
success: function (res) {
i++;
alert(‘已上傳:’ + i + ‘/’ + length);
images.serverId.push(res.serverId);
if (i length) {
upload();
}
},
fail: function (res) {
alert(JSON.stringify(res));
}
});
}
upload();
});
// 5.4 下載圖片
$(“#download”).click(function(){
if (images.serverId.length === 0) {
alert(‘請先使用 uploadImage 上傳圖片’);
return;
}
var i = 0, length = images.serverId.length;
images.localId = [];
function download() {
wx.downloadImage({
serverId: images.serverId[i],
success: function (res) {
i++;
alert(‘已下載:’ + i + ‘/’ + length);
images.localId.push(res.localId);
if (i length) {
download();
}
}
});
}
download();
});
Android怎麼調用php寫的網路介面
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(“?”+ “tel=” + tel);
HttpResponse response = httpclient.execute(httpget);
相應的api.php:
$tel= $_GET[‘tel’];
怎樣把安卓的照片上傳到php的伺服器
可以用php寫app介面給安卓軟體調用,比如寫一個圖片上傳介面,然後在圖片上傳的時候將信息傳入這介面就可以了。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/312958.html