IWXAPI api = WXAPIFactory.createWXAPI(mContext, appId,false);
WXFileObject fileObj = new WXFileObject();
fileObj.setContentLengthLimit(imagedata.length);
Log.d(TAG, "length: "+imagedata.length);
fileObj.fileData = imagedata;
fileObj.filePath = path;
WXMediaMessage msg = new WXMediaMessage(fileObj);
msg.title = title;
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "file" + System.currentTimeMillis();
req.message = msg;
req.scene = SendMessageToWX.Req.WXSceneSession;
api.sendReq(req);