public static String encodeBase64File(String path) throws Exception {
File file = new File(path);
FileInputStream inputFile = new FileInputStream(file);
byte[] buffer = new byte[(int)file.length()];
inputFile.read(buffer);
inputFile.close();
return Base64.encodeToString(buffer, Base64.DEFAULT);

}




//特别注意这里要把参数URLEncoder.encode 这个问题害我不浅

params.put("photos", URLEncoder.encode(base64Code, "UTF-8"));



更多相关文章

  1. ui布局参数设置
  2. android线性布局参数详解
  3. android_relative布局参数学习
  4. Android 模拟器创建参数说明
  5. 参数设置
  6. android图片压缩质量参数Bitmap.Config RGB_565等的含义

随机推荐

  1. Android Content Provider 之Contacts数
  2. [Android GMS 认证] STS 问题列表之 andr
  3. 在PC上体验Android,别人是别人,我的是我的
  4. Android模糊效果的网格菜单:BlurredGridMe
  5. android之数据库和Content Provider(三)
  6. Gradle基础
  7. Android 选择并裁剪头像
  8. TabHost的基本使用方法
  9. android实践项目七自定义的Spinner
  10. android上传图片以及POST字符串